Coverage Report - org.apache.tapestry.services.impl.EngineServiceInnerProxy
 
Classes in this File Line Coverage Branch Coverage Complexity
EngineServiceInnerProxy
0%
0/16
N/A
1
 
 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  
     public EngineServiceInnerProxy(String serviceName, EngineServiceOuterProxy outerProxy,
 45  
             EngineServiceSource source)
 46  0
     {
 47  0
         Defense.notNull(serviceName, "serviceName");
 48  0
         Defense.notNull(outerProxy, "outerProxy");
 49  0
         Defense.notNull(source, "source");
 50  
 
 51  0
         _serviceName = serviceName;
 52  0
         _outerProxy = outerProxy;
 53  0
         _source = source;
 54  0
     }
 55  
 
 56  
     public String toString()
 57  
     {
 58  0
         return ImplMessages.engineServiceInnerProxyToString(_serviceName);
 59  
     }
 60  
 
 61  
     private IEngineService resolve()
 62  
     {
 63  0
         IEngineService service = _source.resolveEngineService(_serviceName);
 64  
 
 65  0
         _outerProxy.installDelegate(service);
 66  
 
 67  0
         return service;
 68  
     }
 69  
 
 70  
     public synchronized ILink getLink(boolean post, Object parameter)
 71  
     {
 72  0
         return resolve().getLink(post, parameter);
 73  
     }
 74  
 
 75  
     public synchronized void service(IRequestCycle cycle) throws IOException
 76  
     {
 77  0
         resolve().service(cycle);
 78  0
     }
 79  
 
 80  
     public String getName()
 81  
     {
 82  0
         return _serviceName;
 83  
     }
 84  
 
 85  
 }