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 void
cleanupClass(Class clazz)
Remote
createHomeReference(byte[] homeKey)
Create a remote reference for an EJBHome which can be used for performing remote invocations.Remote
createRemoteReference(byte[] instanceKey)
Create a remote reference for an EJBObject which can be used for performing remote invocations.void
destroy()
Destroy the factory itself.void
destroyReference(Remote remoteRef, Remote remoteObj)
Disconnect an EJBObject or EJBHome from the ORB.int
getCSIv2PolicyType()
boolean
hasSameContainerID(org.omg.CORBA.Object obj)
void
postinvoke(byte[] ejbKey, org.omg.PortableServer.POA adapter, String operation, Object cookie, org.omg.PortableServer.Servant servant)
org.omg.PortableServer.Servant
preinvoke(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.void
setRepositoryIds(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:
getCSIv2PolicyType
in interfaceRemoteReferenceFactory
-
setRepositoryIds
public void setRepositoryIds(Class homeIntf, Class remoteIntf)
- Specified by:
setRepositoryIds
in interfaceRemoteReferenceFactory
-
cleanupClass
public void cleanupClass(Class clazz)
- Specified by:
cleanupClass
in interfaceRemoteReferenceFactory
-
createRemoteReference
public Remote createRemoteReference(byte[] instanceKey)
Description copied from interface:RemoteReferenceFactory
Create 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:
createRemoteReference
in 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:RemoteReferenceFactory
Create 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:
createHomeReference
in 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:
destroyReference
in 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.ForwardRequest
This 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:
preinvoke
in 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:
postinvoke
in interfaceorg.omg.PortableServer.ServantLocatorOperations
-
destroy
public void destroy()
Description copied from interface:RemoteReferenceFactory
Destroy the factory itself. Called during shutdown / undeploy. The factory is expected to release all resources in this method.- Specified by:
destroy
in interfaceRemoteReferenceFactory
-
hasSameContainerID
public boolean hasSameContainerID(org.omg.CORBA.Object obj) throws Exception
- Specified by:
hasSameContainerID
in interfaceRemoteReferenceFactory
- Throws:
Exception
-
-