StatefulLocalProxypublic class StatefulLocalProxy extends org.jboss.ejb3.LocalProxy implements Externalizable
Fields Summary |
---|
private static final long | serialVersionUID | protected Object | id | org.jboss.aspects.asynch.AsynchProvider | provider |
Methods Summary |
---|
public java.lang.Object | getAsynchronousProxy(java.lang.Object proxy)
Class[] infs = proxy.getClass().getInterfaces();
if (!ProxyUtils.isAsynchronous(infs))
{
Class[] interfaces = ProxyUtils.addAsynchProviderInterface(infs);
AsynchMixin mixin = new AsynchMixin();
StatefulLocalProxy handler = new StatefulLocalProxy(mixin, getContainer(), id);
return Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), interfaces, handler);
}
//I was already asynchronous
return proxy;
| public java.lang.Object | invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
if (method.getDeclaringClass() == AsynchProvider.class)
{
return provider.getFuture();
}
//Make sure we get the cache id before getting the asynchronous interface
StatefulContainer sfsb = (StatefulContainer) getContainer();
Object ret = ProxyUtils.handleCallLocally(proxy, this, method, args);
if (ret != null)
{
return ret;
}
return sfsb.localInvoke(id, method, args, (FutureHolder) provider);
| public void | readExternal(java.io.ObjectInput in)
super.readExternal(in);
id = in.readObject();
| public java.lang.String | toString()
if (id != null)
{
return getContainer().getEjbName().toString() + ":" + id.toString();
}
else
{
//If the proxy has not been used yet, create a temporary id
GUID guid = new GUID();
return getContainer().getEjbName().toString() + ":" + guid.toString();
}
| public void | writeExternal(java.io.ObjectOutput out)
super.writeExternal(out);
out.writeObject(id);
|
|