Clover coverage report - Code Coverage for tapestry release 4.0.2
Coverage timestamp: Thu Apr 13 2006 10:52:06 EDT
file stats: LOC: 85   Methods: 6
NCLOC: 45   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    import java.io.Serializable;
 19   
 20    import org.apache.hivemind.util.Defense;
 21    import org.apache.tapestry.IRequestCycle;
 22    import org.apache.tapestry.engine.IEngineService;
 23    import org.apache.tapestry.engine.ILink;
 24   
 25    /**
 26    * Inner proxy that actually resolves the engine service using the
 27    * {@link org.apache.tapestry.services.impl.EngineServiceSource}, then replaces itself in the outer
 28    * proxy.
 29    *
 30    * @author Howard M. Lewis Ship
 31    * @since 4.0
 32    * @see org.apache.tapestry.services.impl.EngineServiceOuterProxy
 33    */
 34    public class EngineServiceInnerProxy implements IEngineService, Serializable
 35    {
 36    private static final long serialVersionUID = -8128030027597659447L;
 37   
 38    private final String _serviceName;
 39   
 40    private final EngineServiceOuterProxy _outerProxy;
 41   
 42    private final EngineServiceSource _source;
 43   
 44  152 public EngineServiceInnerProxy(String serviceName, EngineServiceOuterProxy outerProxy,
 45    EngineServiceSource source)
 46    {
 47  152 Defense.notNull(serviceName, "serviceName");
 48  152 Defense.notNull(outerProxy, "outerProxy");
 49  152 Defense.notNull(source, "source");
 50   
 51  152 _serviceName = serviceName;
 52  152 _outerProxy = outerProxy;
 53  152 _source = source;
 54    }
 55   
 56  1 public String toString()
 57    {
 58  1 return ImplMessages.engineServiceInnerProxyToString(_serviceName);
 59    }
 60   
 61  122 private IEngineService resolve()
 62    {
 63  122 IEngineService service = _source.resolveEngineService(_serviceName);
 64   
 65  121 _outerProxy.installDelegate(service);
 66   
 67  121 return service;
 68    }
 69   
 70  69 public synchronized ILink getLink(boolean post, Object parameter)
 71    {
 72  69 return resolve().getLink(post, parameter);
 73    }
 74   
 75  53 public synchronized void service(IRequestCycle cycle) throws IOException
 76    {
 77  53 resolve().service(cycle);
 78    }
 79   
 80  1 public String getName()
 81    {
 82  1 return _serviceName;
 83    }
 84   
 85    }