Clover coverage report - Code Coverage for tapestry release 4.0-beta-12
Coverage timestamp: Sun Oct 30 2005 16:22:01 EST
file stats: LOC: 78   Methods: 7
NCLOC: 39   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
EngineServiceOuterProxy.java - 100% 100% 100%
coverage
 1    // Copyright 2005 The Apache Software Foundation
 2    //
 3    // Licensed under the Apache License, Version 2.0 (the "License");
 4    // you may not use this file except in compliance with the License.
 5    // You may obtain a copy of the License at
 6    //
 7    // http://www.apache.org/licenses/LICENSE-2.0
 8    //
 9    // Unless required by applicable law or agreed to in writing, software
 10    // distributed under the License is distributed on an "AS IS" BASIS,
 11    // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12    // See the License for the specific language governing permissions and
 13    // limitations under the License.
 14   
 15    package org.apache.tapestry.services.impl;
 16   
 17    import java.io.IOException;
 18   
 19    import org.apache.hivemind.util.Defense;
 20    import org.apache.tapestry.IRequestCycle;
 21    import org.apache.tapestry.engine.IEngineService;
 22    import org.apache.tapestry.engine.ILink;
 23   
 24    /**
 25    * Outer proxy for engine services. The inner proxy resolves the engine service name to a engine
 26    * service implementation and installed it into the outer proxy as a delegate. Although HiveMind
 27    * does provide a similar system of inner and outer delegates, Tapestry's engine-service:
 28    * {@link org.apache.tapestry.services.impl.EngineServiceObjectProvider} object provider can
 29    * cause exceptions (recurive service build) when attempting to link two services together. This
 30    * extra layer of proxying resolves that issue.
 31    *
 32    * @author Howard M. Lewis Ship
 33    * @since 4.0
 34    */
 35    public class EngineServiceOuterProxy implements IEngineService
 36    {
 37    private final String _serviceName;
 38   
 39    private IEngineService _delegate;
 40   
 41  155 public EngineServiceOuterProxy(String serviceName)
 42    {
 43  155 Defense.notNull(serviceName, "serviceName");
 44   
 45  155 _serviceName = serviceName;
 46    }
 47   
 48  272 void installDelegate(IEngineService delegate)
 49    {
 50  272 _delegate = delegate;
 51    }
 52   
 53  3 IEngineService getDelegate()
 54    {
 55  3 return _delegate;
 56    }
 57   
 58  188 public ILink getLink(IRequestCycle cycle, boolean post, Object parameter)
 59    {
 60  188 return _delegate.getLink(cycle, false, parameter);
 61    }
 62   
 63  130 public void service(IRequestCycle cycle) throws IOException
 64    {
 65  130 _delegate.service(cycle);
 66    }
 67   
 68  247 public String getName()
 69    {
 70  247 return _serviceName;
 71    }
 72   
 73  1 public String toString()
 74    {
 75  1 return ImplMessages.engineServiceOuterProxyToString(_serviceName);
 76    }
 77   
 78    }