Clover coverage report - Code Coverage for tapestry release 4.0-beta-10
Coverage timestamp: Sat Oct 8 2005 19:08:05 EDT
file stats: LOC: 82   Methods: 6
NCLOC: 43   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
EngineServiceInnerProxy.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    * Inner proxy that actually resolves the engine service using the
 26    * {@link org.apache.tapestry.services.impl.EngineServiceSource}, then replaces itself in the outer
 27    * proxy.
 28    *
 29    * @author Howard M. Lewis Ship
 30    * @since 4.0
 31    * @see org.apache.tapestry.services.impl.EngineServiceOuterProxy
 32    */
 33    public class EngineServiceInnerProxy implements IEngineService
 34    {
 35    private final String _serviceName;
 36   
 37    private final EngineServiceOuterProxy _outerProxy;
 38   
 39    private final EngineServiceSource _source;
 40   
 41  156 public EngineServiceInnerProxy(String serviceName, EngineServiceOuterProxy outerProxy,
 42    EngineServiceSource source)
 43    {
 44  156 Defense.notNull(serviceName, "serviceName");
 45  156 Defense.notNull(outerProxy, "outerProxy");
 46  156 Defense.notNull(source, "source");
 47   
 48  156 _serviceName = serviceName;
 49  156 _outerProxy = outerProxy;
 50  156 _source = source;
 51    }
 52   
 53  1 public String toString()
 54    {
 55  1 return ImplMessages.engineServiceInnerProxyToString(_serviceName);
 56    }
 57   
 58  126 private IEngineService resolve()
 59    {
 60  126 IEngineService service = _source.resolveEngineService(_serviceName);
 61   
 62  125 _outerProxy.installDelegate(service);
 63   
 64  125 return service;
 65    }
 66   
 67  71 public synchronized ILink getLink(IRequestCycle cycle, boolean post, Object parameter)
 68    {
 69  71 return resolve().getLink(cycle, false, parameter);
 70    }
 71   
 72  55 public synchronized void service(IRequestCycle cycle) throws IOException
 73    {
 74  55 resolve().service(cycle);
 75    }
 76   
 77  1 public String getName()
 78    {
 79  1 return _serviceName;
 80    }
 81   
 82    }