DynamicProxyFactory |
EXAMPLE USAGE
ProxyManager.getProxyClass( Customer.class );
CUSTOMER INTERFACE
public interface Customer extends javax.ejb.EJBObject {
public boolean setAddress(String street, int x, short y) throws RemoteException;
GENERATED PROXY CLASS
public class CustomerProxy extends Proxy implements java.io.Serializable,Customer{
protected static transient java.lang.reflect.Method [] methodMap = new java.lang.reflect.Method[6];
protected CustomerProxy(){}
...// EJBObject methods
public boolean setAddress( java.lang.String parm0,int parm1,short parm2) throws java.rmi.RemoteException{
// obtain method
java.lang.reflect.Method method = methodMap[5];
if(method == null){
try{
method=Customer.class.getMethod("setAddress",new Class [] { java.lang.String.class,int.class,short.class});
methodMap[5] = method;
}catch(NoSuchMethodException nsme){ throw new RuntimeException();}
}
// package arguments
Object [] args = new Object[3];
args[0] = parm0;
args[1] = new java.lang.Integer(parm1);
args[2] = new java.lang.Short(parm2);
try{
java.lang.Boolean retval = (java.lang.Boolean)handler.invoke(this,method,args);
return retval.booleanValue( );
}catch(Throwable t){
// rethrow exceptions
if(t instanceof java.rmi.RemoteException)
throw (java.rmi.RemoteException)t;
if(t instanceof RuntimeException)
throw (RuntimeException)t;
else
throw (Error)t;
}
} |