FutureInvocationHandlerpublic class FutureInvocationHandler extends org.jboss.aop.proxy.Proxy implements Serializable, org.jboss.aop.instrument.Untransformable, InvocationHandlerAn invocation handler for the Future interface using dynamic proxies. It is an alternative to
having generated proxies for use with EJB 3, avoiding client relying on javassist in the
EJB 3 client proxies |
Fields Summary |
---|
private static final long | serialVersionUID | private Map | methodMap |
Constructors Summary |
---|
public FutureInvocationHandler()
// FIXME FutureInvocationHandler constructor
super();
|
Methods Summary |
---|
public static java.lang.Object | createFutureProxy(org.jboss.util.id.GUID guid, java.lang.ClassLoader loader, java.lang.Class[] interfaces)
FutureInvocationHandler ih = new FutureInvocationHandler();
ih.instanceAdvisor = new ClassInstanceAdvisor();
ih.mixins = null;
ih.interfaces = interfaces;
ih.guid = guid;
return java.lang.reflect.Proxy.newProxyInstance(loader, interfaces, ih);
| public java.util.Map | getMethodMap()
//I don't think we need to populate this for now
return methodMap;
| public java.lang.Object | invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
if (method.getName().equals("_getInstanceAdvisor"))
{
return _getInstanceAdvisor();
}
else if (method.getName().equals("_setInstanceAdvisor") &&
method.getParameterTypes().length == 1 && method.getParameterTypes()[0].equals(InstanceAdvisor.class))
{
_setInstanceAdvisor((InstanceAdvisor)args[0]);
return null;
}
Interceptor[] interceptors = instanceAdvisor.getInterceptors();
long hash = MethodHashing.calculateHash(method);
MethodInvocation invocation = new MethodInvocation(interceptors, hash, method, method, null);
invocation.setInstanceResolver(instanceAdvisor.getMetaData());
invocation.setArguments(args);
return invocation.invokeNext();
| public java.lang.Object | writeReplace()Override Proxy implementation so we get default behaviour.
Reason is to avoid client dependencies on javassist in EJB 3 asynchronous proxies
return this;
|
|