org.openejb.core.stateful
Class StatefulEjbHomeHandler

java.lang.Object
  |
  +--org.openejb.core.ivm.BaseEjbProxyHandler
        |
        +--org.openejb.core.ivm.EjbHomeProxyHandler
              |
              +--org.openejb.core.stateful.StatefulEjbHomeHandler
All Implemented Interfaces:
InvocationHandler, java.io.Serializable

public class StatefulEjbHomeHandler
extends EjbHomeProxyHandler

This InvocationHandler and its proxy are serializable and can be used by HomeHandle, Handle, and MetaData to persist and revive handles. It maintains its original client identity which allows the container to be more discerning about allowing the revieed proxy to be used. See StatefulContaer manager for more details.

See Also:
Serialized Form

Fields inherited from class org.openejb.core.ivm.BaseEjbProxyHandler
container, debug, deploymentID, deploymentInfo, doIntraVmCopy, inProxyMap, isInvalidReference, liveHandleRegistry, primaryKey
 
Constructor Summary
StatefulEjbHomeHandler(RpcContainer container, java.lang.Object pk, java.lang.Object depID)
           
 
Method Summary
protected  java.lang.Object createProxy(ProxyInfo proxyInfo)
           
protected  java.lang.Object findX(java.lang.reflect.Method method, java.lang.Object[] args, java.lang.Object proxy)
          EJB 1.1 Specification, Section 5.5 Session object identity Since all session objects hide their identity, there is no need to provide a finder for them.
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  EjbObjectProxyHandler newEjbObjectHandler(RpcContainer container, java.lang.Object pk, java.lang.Object depID)
           
protected  java.lang.Object removeByPrimaryKey(java.lang.reflect.Method method, java.lang.Object[] args, java.lang.Object proxy)
          ------------------------------------ 5.3.2 Removing a session object A client may remove a session object using the remove() method on the javax.ejb.EJBObject interface, or the remove(Handle handle) method of the javax.ejb.EJBHome interface.
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.EjbHomeProxyHandler
_invoke, _writeReplace, create, getHomeHandle, getProxyInfo
 
Methods inherited from class org.openejb.core.ivm.BaseEjbProxyHandler
, checkAuthorization, copyArgs, copyObj, getThreadSpecificSecurityIdentity, invalidateAllHandlers, invalidateReference, invoke, log, registerHandler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StatefulEjbHomeHandler

public StatefulEjbHomeHandler(RpcContainer container,
                              java.lang.Object pk,
                              java.lang.Object depID)
Method Detail

createProxy

protected java.lang.Object createProxy(ProxyInfo proxyInfo)
Overrides:
createProxy in class EjbHomeProxyHandler

findX

protected java.lang.Object findX(java.lang.reflect.Method method,
                                 java.lang.Object[] args,
                                 java.lang.Object proxy)
                          throws java.lang.Throwable
EJB 1.1 Specification, Section 5.5 Session object identity Since all session objects hide their identity, there is no need to provide a finder for them. The home interface of a session bean must not define any finder methods.
Overrides:
findX in class EjbHomeProxyHandler
Parameters:
method -  
args -  
proxy -  
Returns:
Returns an new EJBObject proxy and handler
Throws:
java.lang.Throwable -  

removeByPrimaryKey

protected java.lang.Object removeByPrimaryKey(java.lang.reflect.Method method,
                                              java.lang.Object[] args,
                                              java.lang.Object proxy)
                                       throws java.lang.Throwable
------------------------------------ 5.3.2 Removing a session object A client may remove a session object using the remove() method on the javax.ejb.EJBObject interface, or the remove(Handle handle) method of the javax.ejb.EJBHome interface. Because session objects do not have primary keys that are accessible to clients, invoking the javax.ejb.EJBHome.remove(Object primaryKey) method on a session results in the javax.ejb.RemoveException. ------------------------------------ 5.5 Session object identity Session objects are intended to be private resources used only by the client that created them. For this reason, session objects, from the client’s perspective, appear anonymous. In contrast to entity objects, which expose their identity as a primary key, session objects hide their identity. As a result, the EJBObject.getPrimaryKey() and EJBHome.remove(Object primaryKey) methods result in a java.rmi.RemoteException if called on a session bean. If the EJBMetaData.getPrimaryKeyClass() method is invoked on a EJBMetaData object for a Session bean, the method throws the java.lang.RuntimeException. ------------------------------------ Sections 5.3.2 and 5.5 conflict. 5.3.2 says to throw javax.ejb.RemoveException, 5.5 says to throw java.rmi.RemoteException. For now, we are going with java.rmi.RemoteException.
Overrides:
removeByPrimaryKey in class EjbHomeProxyHandler
Following copied from class: org.openejb.core.ivm.EjbHomeProxyHandler
Parameters:
method -  
args -  
Returns:
Returns null
Throws:
java.lang.Throwable -  
See Also:
EJBHome, EJBHome.remove(java.lang.Object)

removeWithHandle

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.

Overrides:
removeWithHandle in class EjbHomeProxyHandler
Parameters:
method -  
args -  
Returns:
Returns null
Throws:
java.lang.Throwable -  
See Also:
EJBHome, EJBHome.remove(java.lang.Object)

getEJBMetaData

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.

Overrides:
getEJBMetaData in class EjbHomeProxyHandler
Returns:
Returns an IntraVmMetaData
Throws:
java.lang.Throwable -  
See Also:
IntraVmMetaData, EJBHome, EJBHome.getEJBMetaData()

newEjbObjectHandler

protected EjbObjectProxyHandler newEjbObjectHandler(RpcContainer container,
                                                    java.lang.Object pk,
                                                    java.lang.Object depID)
Overrides:
newEjbObjectHandler in class EjbHomeProxyHandler