Clover coverage report - CRISPY - 1.1.1
Coverage timestamp: Mi Nov 15 2006 13:09:46 CET
file stats: LOC: 49   Methods: 3
NCLOC: 24   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
RmiExecutor.java 100% 100% 100% 100%
coverage
 1    package net.sf.crispy.impl;
 2   
 3    import java.lang.reflect.Method;
 4    import java.rmi.Naming;
 5    import java.util.Vector;
 6   
 7    import net.sf.crispy.ExceptionWrapper;
 8    import net.sf.crispy.Executor;
 9    import net.sf.crispy.impl.rmi.RmiInvocationHandler;
 10    import net.sf.crispy.util.Invoker;
 11   
 12    /**
 13    * Remote-Call with Remote Method Invocation (RMI).
 14    *
 15    * @author Linke
 16    */
 17   
 18    public class RmiExecutor extends Executor {
 19   
 20    /**
 21    *
 22    * @uml.property name="dEFAULT_URL_AND_PORT"
 23    * @uml.associationEnd inverse=":java.lang.String" changeability="frozen" multiplicity=
 24    * "(0 1)"
 25    */
 26    public final static String DEFAULT_URL_AND_PORT = "rmi://localhost:1098";
 27   
 28    public final static String LOOKUP_NAME = "RmiInvocationHandler";
 29   
 30    private RmiInvocationHandler rmiInvocationHandler = null;
 31   
 32  96 public String getDefaultUrlAndPort() { return DEFAULT_URL_AND_PORT; }
 33   
 34  58 public boolean withConverter() { return true; }
 35   
 36  58 public Object execute(Class pvProxyClass, Object pvProxy, Method pvMethod, Object[] pvArgs) throws Exception {
 37  58 if (rmiInvocationHandler == null) {
 38  37 String lvLookupStr = getUrlAndPort() + "/" + LOOKUP_NAME;
 39  37 rmiInvocationHandler = (RmiInvocationHandler) Naming.lookup(lvLookupStr);
 40    }
 41  58 Vector lvParams = Invoker.array2Vector(pvArgs);
 42  58 Object lvReturn = rmiInvocationHandler.invoke(pvProxyClass.getName(), pvMethod.getName(), lvParams);
 43   
 44  58 lvReturn = ExceptionWrapper.isResultExceptionThanThrowIt(lvReturn);
 45   
 46  56 return lvReturn;
 47    }
 48   
 49    }