Class POARemoteReferenceFactory
- java.lang.Object
-
- org.omg.CORBA.LocalObject
-
- org.glassfish.enterprise.iiop.impl.POARemoteReferenceFactory
-
- All Implemented Interfaces:
Serializable,RemoteReferenceFactory,org.omg.CORBA.Object,org.omg.CORBA.portable.IDLEntity,org.omg.PortableServer.ServantLocator,org.omg.PortableServer.ServantLocatorOperations,org.omg.PortableServer.ServantManager,org.omg.PortableServer.ServantManagerOperations
public final class POARemoteReferenceFactory extends org.omg.CORBA.LocalObject implements RemoteReferenceFactory, org.omg.PortableServer.ServantLocator
This class implements the RemoteReferenceFactory interface for the RMI/IIOP ORB with POA (Portable Object Adapter). There is one instance of the POARemoteReferenceFactory for each EJB type. It also implements the preinvoke/postinvoke APIs in the POA's ServantLocator interface, which are called before/after every invocation (local or remote). It creates a RMI-IIOP-POA object reference (a stub) for every EJBObject and EJBHome in the EJB container.- Author:
- Kenneth Saks
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcleanupClass(Class clazz)RemotecreateHomeReference(byte[] homeKey)Create a remote reference for an EJBHome which can be used for performing remote invocations.RemotecreateRemoteReference(byte[] instanceKey)Create a remote reference for an EJBObject which can be used for performing remote invocations.voiddestroy()Destroy the factory itself.voiddestroyReference(Remote remoteRef, Remote remoteObj)Disconnect an EJBObject or EJBHome from the ORB.intgetCSIv2PolicyType()booleanhasSameContainerID(org.omg.CORBA.Object obj)voidpostinvoke(byte[] ejbKey, org.omg.PortableServer.POA adapter, String operation, Object cookie, org.omg.PortableServer.Servant servant)org.omg.PortableServer.Servantpreinvoke(byte[] ejbKey, org.omg.PortableServer.POA adapter, String operation, org.omg.PortableServer.ServantLocatorPackage.CookieHolder cookieHolder)This is the implementation of ServantLocator.preinvoke() It is called from the POA before every remote invocation.voidsetRepositoryIds(Class homeIntf, Class remoteIntf)-
Methods inherited from class org.omg.CORBA.LocalObject
_create_request, _create_request, _duplicate, _get_domain_managers, _get_interface, _get_interface_def, _get_policy, _hash, _invoke, _is_a, _is_equivalent, _is_local, _non_existent, _orb, _release, _releaseReply, _request, _request, _servant_postinvoke, _servant_preinvoke, _set_policy_override, validate_connection
-
-
-
-
Method Detail
-
getCSIv2PolicyType
public int getCSIv2PolicyType()
- Specified by:
getCSIv2PolicyTypein interfaceRemoteReferenceFactory
-
setRepositoryIds
public void setRepositoryIds(Class homeIntf, Class remoteIntf)
- Specified by:
setRepositoryIdsin interfaceRemoteReferenceFactory
-
cleanupClass
public void cleanupClass(Class clazz)
- Specified by:
cleanupClassin interfaceRemoteReferenceFactory
-
createRemoteReference
public Remote createRemoteReference(byte[] instanceKey)
Description copied from interface:RemoteReferenceFactoryCreate a remote reference for an EJBObject which can be used for performing remote invocations. The key specifies the unique "object-id" of the EJBObject. This operation should not create any "tie" for the particular remote object instance. This operation should not cause the ProtocolManager to maintain any instance-specific state about the EJB instance.- Specified by:
createRemoteReferencein interfaceRemoteReferenceFactory- Parameters:
instanceKey- a unique identifier for the EJB instance which is unique across all EJB refs created using this RemoteReferenceFactory instance.- Returns:
- the protocol-specific stub of the proper derived type. It should not be necessary to narrow this stub again.
-
createHomeReference
public Remote createHomeReference(byte[] homeKey)
Description copied from interface:RemoteReferenceFactoryCreate a remote reference for an EJBHome which can be used for performing remote invocations. The key specifies the unique "object-id" of the EJBHome. This operation should not create any "tie" for the particular remote object instance. This operation should not cause the ProtocolManager to maintain any instance-specific state about the EJB instance.- Specified by:
createHomeReferencein interfaceRemoteReferenceFactory- Parameters:
homeKey- a unique identifier for the EJB instance which is unique across all EJB refs created using this RemoteReferenceFactory instance.- Returns:
- the protocol-specific stub of the proper derived type. It should not be necessary to narrow this stub again.
-
destroyReference
public void destroyReference(Remote remoteRef, Remote remoteObj)
Disconnect an EJBObject or EJBHome from the ORB.- Specified by:
destroyReferencein interfaceRemoteReferenceFactory- Parameters:
remoteRef- the remote reference for the EJBObject/EJBHomeremoteObj- the servant corresponding to the remote reference.
-
preinvoke
public org.omg.PortableServer.Servant preinvoke(byte[] ejbKey, org.omg.PortableServer.POA adapter, String operation, org.omg.PortableServer.ServantLocatorPackage.CookieHolder cookieHolder) throws org.omg.PortableServer.ForwardRequestThis is the implementation of ServantLocator.preinvoke() It is called from the POA before every remote invocation. Return a POA Servant (which is the RMI/IIOP Tie for EJBObject/EJBHome).- Specified by:
preinvokein interfaceorg.omg.PortableServer.ServantLocatorOperations- Parameters:
ejbKey-cookieHolder-- Throws:
org.omg.PortableServer.ForwardRequest
-
postinvoke
public void postinvoke(byte[] ejbKey, org.omg.PortableServer.POA adapter, String operation, Object cookie, org.omg.PortableServer.Servant servant)- Specified by:
postinvokein interfaceorg.omg.PortableServer.ServantLocatorOperations
-
destroy
public void destroy()
Description copied from interface:RemoteReferenceFactoryDestroy the factory itself. Called during shutdown / undeploy. The factory is expected to release all resources in this method.- Specified by:
destroyin interfaceRemoteReferenceFactory
-
hasSameContainerID
public boolean hasSameContainerID(org.omg.CORBA.Object obj) throws Exception- Specified by:
hasSameContainerIDin interfaceRemoteReferenceFactory- Throws:
Exception
-
-