|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openejb.core.ivm.BaseEjbProxyHandler
org.openejb.core.ivm.EjbHomeProxyHandler
public abstract class EjbHomeProxyHandler
This is an InvocationHandler that is used only for handling requests from an EJBHome stub. The EjbHomeProxyHandler handles all in-VM requests from the EJBHome stub. The EjbHomeProxyHandler is different from the EjbObjectProxyHandler in that it does not need to be synchronized. One instance of the EjbHomeProxyHandler can be used by all instances of the EJBObject stub in the same VM as the bean deployment they represent. This InvocationHandler and its proxy are serializable and can be used by HomeHandle, Handle, and MetaData to persist and revive handles to the EJBHome. It maintains its original client identity which allows the container to be more discerning about allowing the revieed proxy to be used. See StatefulContainer manager for more details.
EjbObjectProxyHandler
,
StatefulContainer
,
Serialized FormField Summary | |
---|---|
protected static org.apache.log4j.Category |
logger
|
Fields inherited from class org.openejb.core.ivm.BaseEjbProxyHandler |
---|
container, deploymentID, deploymentInfo, doIntraVmCopy, inProxyMap, isInvalidReference, liveHandleRegistry, primaryKey |
Constructor Summary | |
---|---|
EjbHomeProxyHandler(RpcContainer container,
java.lang.Object pk,
java.lang.Object depID)
Constructs an EjbHomeProxyHandler to handle invocations from an EJBHome stub/proxy. |
Method Summary | |
---|---|
protected java.lang.Object |
_invoke(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args)
Overridden by subclasses and called by BaseEjbProxyHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[]) . |
protected java.lang.Object |
_writeReplace(java.lang.Object proxy)
The writeReplace method is invoked on the proxy when it enters the serialization process. |
protected java.lang.Object |
create(java.lang.reflect.Method method,
java.lang.Object[] args,
java.lang.Object proxy)
Creates a new EJBObject and returns it to the caller. |
protected java.lang.Object |
createProxy(ProxyInfo proxyInfo)
|
protected abstract java.lang.Object |
findX(java.lang.reflect.Method method,
java.lang.Object[] args,
java.lang.Object proxy)
Locates and returns a new EJBObject or a collection of EJBObjects. |
protected java.lang.Object |
getEJBMetaData(java.lang.reflect.Method method,
java.lang.Object[] args,
java.lang.Object proxy)
Returns an EJBMetaData implementation that is valid inside this virtual machine. |
protected java.lang.Object |
getHomeHandle(java.lang.reflect.Method method,
java.lang.Object[] args,
java.lang.Object proxy)
Returns a HomeHandle implementation that is valid inside this virtual machine. |
ProxyInfo |
getProxyInfo()
|
void |
invalidateReference()
Invalidates this reference so that it can not be used as a proxy for the bean identity. |
protected abstract EjbObjectProxyHandler |
newEjbObjectHandler(RpcContainer container,
java.lang.Object pk,
java.lang.Object depID)
|
protected abstract java.lang.Object |
removeByPrimaryKey(java.lang.reflect.Method method,
java.lang.Object[] args,
java.lang.Object proxy)
Attempts to remove an EJBObject from the container system. |
protected java.lang.Object |
removeWithHandle(java.lang.reflect.Method method,
java.lang.Object[] args,
java.lang.Object proxy)
Attempts to remove an EJBObject from the container system. |
Methods inherited from class org.openejb.core.ivm.BaseEjbProxyHandler |
---|
checkAuthorization, copyArgs, copyObj, equals, getThreadSpecificSecurityIdentity, hashCode, invalidateAllHandlers, invoke, isLocal, registerHandler, setIntraVmCopyMode, setLocal, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final org.apache.log4j.Category logger
Constructor Detail |
---|
public EjbHomeProxyHandler(RpcContainer container, java.lang.Object pk, java.lang.Object depID)
container
- The Container that the bean deployment this stub hanlder represents is deployed in.pk
- The primary key of the bean deployment or null if the deployment is a bean type that doesn't require a primary key.depID
- The unique id of the bean deployment that this stub handler will represent.Method Detail |
---|
public void invalidateReference()
BaseEjbProxyHandler
invalidateReference
in class BaseEjbProxyHandler
protected java.lang.Object createProxy(ProxyInfo proxyInfo)
protected abstract EjbObjectProxyHandler newEjbObjectHandler(RpcContainer container, java.lang.Object pk, java.lang.Object depID)
protected java.lang.Object _invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args) throws java.lang.Throwable
BaseEjbProxyHandler
BaseEjbProxyHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
. Subclasses implement the main behavior of calling invoke on the Container that the bean deployment lives in.
_invoke
in class BaseEjbProxyHandler
proxy
- The Proxy subclass that is the bean's EJBObject or EJBHome.method
- The bean method that the caller is attempting to invoke.args
- The arguments to the method being invoked.
java.lang.Throwable
protected java.lang.Object create(java.lang.reflect.Method method, java.lang.Object[] args, java.lang.Object proxy) throws java.lang.Throwable
Creates a new EJBObject and returns it to the caller. The EJBObject is a new proxy with a new handler. This implementation should not be sent outside the virtual machine.
This method propogates to the container system.
The create method is required to be defined by the bean's home interface.
method
- args
- proxy
-
java.lang.Throwable
protected abstract java.lang.Object findX(java.lang.reflect.Method method, java.lang.Object[] args, java.lang.Object proxy) throws java.lang.Throwable
Locates and returns a new EJBObject or a collection of EJBObjects. The EJBObject(s) is a new proxy with a new handler. This implementation should not be sent outside the virtual machine.
This method propogates to the container system.
The find method is required to be defined by the bean's home interface of Entity beans.
method
- args
- proxy
-
java.lang.Throwable
protected java.lang.Object getEJBMetaData(java.lang.reflect.Method method, java.lang.Object[] args, java.lang.Object proxy) throws java.lang.Throwable
Returns an EJBMetaData implementation that is valid inside this virtual machine. This implementation should not be sent outside the virtual machine.
This method does not propogate to the container system.
getMetaData is a method of javax.ejb.EJBHome
Checks if the caller is authorized to invoke the javax.ejb.EJBHome.getMetaData on the EJBHome of the deployment.
java.lang.Throwable
IntraVmMetaData
,
EJBHome
,
EJBHome.getEJBMetaData()
protected java.lang.Object getHomeHandle(java.lang.reflect.Method method, java.lang.Object[] args, java.lang.Object proxy) throws java.lang.Throwable
Returns a HomeHandle implementation that is valid inside this virtual machine. This implementation should not be sent outside the virtual machine.
This method does not propogate to the container system.
getHomeHandle is a method of javax.ejb.EJBHome
Checks if the caller is authorized to invoke the javax.ejb.EJBHome.getHomeHandle on the EJBHome of the deployment.
proxy
-
java.lang.Throwable
IntraVmHandle
,
EJBHome
,
EJBHome.getHomeHandle()
public ProxyInfo getProxyInfo()
getProxyInfo
in class BaseEjbProxyHandler
protected java.lang.Object _writeReplace(java.lang.Object proxy) throws java.io.ObjectStreamException
_writeReplace
in class BaseEjbProxyHandler
proxy
-
java.io.ObjectStreamException
protected java.lang.Object removeWithHandle(java.lang.reflect.Method method, java.lang.Object[] args, java.lang.Object proxy) throws java.lang.Throwable
Attempts to remove an EJBObject from the container system. The EJBObject to be removed is represented by the javax.ejb.Handle object passed into the remove method in the EJBHome.
This method propogates to the container system.
remove(Handle handle) is a method of javax.ejb.EJBHome
Checks if the caller is authorized to invoke the javax.ejb.EJBHome.remove on the EJBHome of the deployment.
TODO: this method relies on the fact that the handle implementation is a subclass of IntraVM handle, which isn't neccessarily the case for arbitrary remote protocols. Also, for all other but IntraVM handles, the stub invalidation doesn't currently work.
method
- args
-
java.lang.Throwable
EJBHome
,
EJBHome.remove(javax.ejb.Handle)
protected abstract java.lang.Object removeByPrimaryKey(java.lang.reflect.Method method, java.lang.Object[] args, java.lang.Object proxy) throws java.lang.Throwable
Attempts to remove an EJBObject from the container system. The EJBObject to be removed is represented by the primaryKey passed into the remove method of the EJBHome.
This method propogates to the container system.
remove(Object primary) is a method of javax.ejb.EJBHome
Checks if the caller is authorized to invoke the javax.ejb.EJBHome.remove on the EJBHome of the deployment.
method
- args
-
java.lang.Throwable
EJBHome
,
EJBHome.remove(javax.ejb.Handle)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |