EJBLocalObjectInvocationHandlerDelegatepublic class EJBLocalObjectInvocationHandlerDelegate extends Object implements InvocationHandlerThis class is used as a "proxy" or adapter between the business interface
proxy and the EJBLocalObjectInvocationHandler. An instance of this class
is created for each business interface of a bean. All java.lang.Object
methods and mthods of IndirectlySerializable are handled by this
InvocationHandler itself while the business interface methods are delegated
to the delegate (which is the EJBLocalObjectInvocaionHandler). |
Fields Summary |
---|
private Class | intfClass | private long | containerId | private EJBLocalObjectInvocationHandler | delegate |
Constructors Summary |
---|
EJBLocalObjectInvocationHandlerDelegate(Class intfClass, long containerId, EJBLocalObjectInvocationHandler delegate)
this.intfClass = intfClass;
this.containerId = containerId;
this.delegate = delegate;
|
Methods Summary |
---|
public boolean | equals(java.lang.Object other)
boolean result = false;
if ((other != null)
&& (other instanceof EJBLocalObjectInvocationHandlerDelegate)) {
EJBLocalObjectInvocationHandlerDelegate otherDelegate
= (EJBLocalObjectInvocationHandlerDelegate) other;
if ((containerId == otherDelegate.containerId)
&& (intfClass == otherDelegate.intfClass)) {
EJBLocalObjectInvocationHandler otherHandler
= otherDelegate.delegate;
result = (delegate.getKey() != null)
? delegate.getKey().equals(otherHandler.getKey())
: (otherHandler.getKey() == null);
}
}
return result;
| public com.sun.ejb.spi.io.SerializableObjectFactory | getSerializableObjectFactory()
// Note: for stateful SessionBeans, the EJBLocalObjectImpl contains
// a pointer to the EJBContext. We should not serialize it here.
return new SerializableLocalObjectDelegate(
containerId, intfClass.getName(), delegate.getKey(),
delegate.getSfsbClientVersion());
| public int | hashCode()
return (int) containerId;
| public java.lang.Object | invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
Class methodClass = method.getDeclaringClass();
Object result = null;
if( methodClass == java.lang.Object.class ) {
result = InvocationHandlerUtil.invokeJavaObjectMethod
(this, method, args);
} else if( methodClass == IndirectlySerializable.class ) {
result = this.getSerializableObjectFactory();
}else {
result = delegate.invoke(intfClass, method, args);
}
return result;
| public java.lang.String | toString()
return intfClass.getName() + "_" + System.identityHashCode(this);
|
|