Clover coverage report - CRISPY - 1.1.1
Coverage timestamp: Mi Nov 15 2006 13:09:46 CET
file stats: LOC: 64   Methods: 4
NCLOC: 39   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
ServiceEndpointImpl.java 100% 100% 100% 100%
coverage
 1    package net.sf.crispy.server;
 2   
 3    import java.lang.reflect.Method;
 4   
 5    import net.sf.crispy.ExceptionWrapper;
 6    import net.sf.crispy.InterceptorHandler;
 7    import net.sf.crispy.proxy.DynamicJdkProxy;
 8    import net.sf.crispy.proxy.DynamicProxy;
 9    import net.sf.crispy.proxy.InvocationHandler;
 10   
 11    /**
 12    * The default implementation of the <code>ServiceEndpoint</code>.
 13    *
 14    * @author Linke
 15    *
 16    * @since 1.1.0
 17    *
 18    */
 19    public class ServiceEndpointImpl implements ServiceEndpoint {
 20   
 21    private InterceptorHandlerCreator interceptorHandlerCreator = null;
 22   
 23  9 public void setInterceptorHandlerCreator(InterceptorHandlerCreator pvCreator) {
 24  9 interceptorHandlerCreator = pvCreator;
 25    }
 26   
 27  286 public InterceptorHandlerCreator getInterceptorHandlerCreator() {
 28  286 return interceptorHandlerCreator;
 29    }
 30   
 31    /**
 32    * If don't set a <code>InterceptorHandlerCreator</code>, than create a new <code>InterceptorHandler</code> instance.
 33    *
 34    * @return By every call create a new <code>InterceptorHandler</code> instance.
 35    */
 36  262 public final InterceptorHandler createNewInterceptorHandlerInstance() {
 37  262 if (this.getInterceptorHandlerCreator() != null) {
 38  15 return getInterceptorHandlerCreator().createNewInterceptorHandlerInstance();
 39    } else {
 40  247 return new InterceptorHandler();
 41    }
 42    }
 43   
 44  259 public final Object doInvoke(Object pvServiceImpl, Method pvMethod, Object[] pvArgs, InterceptorHandler pvInterceptorHandler) {
 45  259 Object lvResult = null;
 46   
 47  259 InterceptorHandler lvInterceptorHandler = pvInterceptorHandler;
 48  259 if (lvInterceptorHandler == null) {
 49  4 lvInterceptorHandler = createNewInterceptorHandlerInstance();
 50    }
 51   
 52  259 DynamicProxy dynamicProxy = new DynamicJdkProxy();
 53  259 dynamicProxy.setProxyClass(pvServiceImpl.getClass());
 54  259 dynamicProxy.setProxyObject(pvServiceImpl);
 55   
 56  259 try {
 57  259 lvResult = InvocationHandler.doInvoke(dynamicProxy, null, pvMethod, pvArgs, lvInterceptorHandler);
 58    } catch (Exception e) {
 59  12 lvResult = ExceptionWrapper.isThrowableThanHandleThrowable(e);
 60    }
 61  259 return lvResult;
 62    }
 63   
 64    }