Package com.sun.corba.ee.impl.oa.toa
Class TOAImpl
- java.lang.Object
-
- org.omg.CORBA.LocalObject
-
- com.sun.corba.ee.spi.oa.ObjectAdapterBase
-
- com.sun.corba.ee.impl.oa.toa.TOAImpl
-
- All Implemented Interfaces:
TOA
,ObjectAdapter
,Object
@ManagedObject @Description("The Transient Object Adapter") public class TOAImpl extends ObjectAdapterBase implements TOA
The Transient Object Adapter (TOA) represents the OA for purely transient objects. It is used for standard RMI-IIOP as well as backwards compatible server support (i.e. the ORB.connect() method) Its characteristics include:- There is only one OA instance of the TOA. Its OAId is { "TOA" }
- There is not adapter manager. The TOA manager ID is fixed.
- State is the same as ORB state (TBD)
- All object adapters must invoke ORB.adapterCreated when they are created.
- All adapter managers must invoke ORB.adapterManagerStateChanged when their state changes, mapping the internal state to an ORT state.
- AdapterStateChanged must be invoked (from somewhere) whenever an adapter state changes that is not due to an adapter manager state change.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
codebase
private static java.util.concurrent.atomic.AtomicLong
currentId
private long
id
private TransientObjectManager
servants
-
Fields inherited from class com.sun.corba.ee.spi.oa.ObjectAdapterBase
wrapper
-
-
Constructor Summary
Constructors Constructor Description TOAImpl(ORB orb, TransientObjectManager tom, java.lang.String codebase)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
connect(Object objref)
Connect the given servant to the ORB by allocating a transient object key and creating an IOR and object reference using the current factory.void
disconnect(Object objref)
Disconnect the object from this ORB.void
enter()
enter must be called before each request is invoked on a servant.void
exit()
exit must be called after each request has been completed.private java.lang.String
getCodebase()
Policy
getEffectivePolicy(int type)
private long
getId()
java.lang.String[]
getInterfaces(java.lang.Object servant, byte[] objectId)
Return the most derived interface for the given servant and objectId.void
getInvocationServant(OAInvocationInfo info)
Get the servant for the request given by the parameters.Object
getLocalServant(byte[] objectId)
Get the servant corresponding to the given objectId, if this is supported.int
getManagerId()
Return the ID of the AdapterManager for this object adapter.org.glassfish.pfl.dynamic.copyobject.spi.ObjectCopierFactory
getObjectCopierFactory()
short
getState()
Return the current state of this object adapter (seeorg.omg.PortableInterceptor
for states).private TransientObjectManager
getTransientObjectManager()
void
returnServant()
Must be called every time getInvocationServant is called after the request has completed.-
Methods inherited from class com.sun.corba.ee.spi.oa.ObjectAdapterBase
getAdapterId, getAdapterTemplate, getCurrentFactory, getIORTemplate, getORB, initializeTemplate, isNameService, makeInvocationInfo, makeObject, setCurrentFactory, setNameService, wrapper
-
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
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.sun.corba.ee.spi.oa.ObjectAdapter
getAdapterTemplate, getCurrentFactory, getIORTemplate, getORB, isNameService, makeInvocationInfo, setCurrentFactory, setNameService
-
-
-
-
Field Detail
-
currentId
private static java.util.concurrent.atomic.AtomicLong currentId
-
servants
private TransientObjectManager servants
-
id
private long id
-
codebase
private java.lang.String codebase
-
-
Constructor Detail
-
TOAImpl
public TOAImpl(ORB orb, TransientObjectManager tom, java.lang.String codebase)
-
-
Method Detail
-
getId
@NameValue private long getId()
-
getCodebase
@ManagedAttribute @Description("The codebase used to create this TOA") private java.lang.String getCodebase()
-
getTransientObjectManager
@ManagedAttribute @Description("The TransientObjectManager") private TransientObjectManager getTransientObjectManager()
-
getObjectCopierFactory
public org.glassfish.pfl.dynamic.copyobject.spi.ObjectCopierFactory getObjectCopierFactory()
- Specified by:
getObjectCopierFactory
in classObjectAdapterBase
-
getLocalServant
public Object getLocalServant(byte[] objectId)
Description copied from interface:ObjectAdapter
Get the servant corresponding to the given objectId, if this is supported. This method is only used for models where the servant is an ObjectImpl, which allows the servant to be used directly as the stub. This allows an object reference to be replaced by its servant when it is unmarshalled locally. Such objects are not ORB mediated.- Specified by:
getLocalServant
in interfaceObjectAdapter
- Specified by:
getLocalServant
in classObjectAdapterBase
- Parameters:
objectId
- byte array representing the object ID- Returns:
- corresponding servant
-
getInvocationServant
public void getInvocationServant(OAInvocationInfo info)
Get the servant for the request given by the parameters. This will update thread Current, so that subsequent calls to returnServant and removeCurrent from the same thread are for the same request.- Specified by:
getInvocationServant
in interfaceObjectAdapter
- Specified by:
getInvocationServant
in classObjectAdapterBase
- Parameters:
info
- is the request containing the rest of the request
-
returnServant
public void returnServant()
Description copied from interface:ObjectAdapter
Must be called every time getInvocationServant is called after the request has completed.- Specified by:
returnServant
in interfaceObjectAdapter
- Specified by:
returnServant
in classObjectAdapterBase
-
getInterfaces
public java.lang.String[] getInterfaces(java.lang.Object servant, byte[] objectId)
Return the most derived interface for the given servant and objectId.- Specified by:
getInterfaces
in interfaceObjectAdapter
- Specified by:
getInterfaces
in classObjectAdapterBase
- Parameters:
servant
- servant objectobjectId
- byte array forming the objectId- Returns:
- list of derived interfaces
-
getEffectivePolicy
public Policy getEffectivePolicy(int type)
- Specified by:
getEffectivePolicy
in interfaceObjectAdapter
- Specified by:
getEffectivePolicy
in classObjectAdapterBase
-
getManagerId
public int getManagerId()
Description copied from interface:ObjectAdapter
Return the ID of the AdapterManager for this object adapter.- Specified by:
getManagerId
in interfaceObjectAdapter
- Specified by:
getManagerId
in classObjectAdapterBase
- Returns:
- the identifier
-
getState
public short getState()
Description copied from interface:ObjectAdapter
Return the current state of this object adapter (seeorg.omg.PortableInterceptor
for states).- Specified by:
getState
in interfaceObjectAdapter
- Specified by:
getState
in classObjectAdapterBase
- Returns:
- the current state of this object adapter
- See Also:
org.omg.PortableInterceptor
-
enter
public void enter() throws OADestroyed
Description copied from interface:ObjectAdapter
enter must be called before each request is invoked on a servant.- Specified by:
enter
in interfaceObjectAdapter
- Specified by:
enter
in classObjectAdapterBase
- Throws:
OADestroyed
- is thrown when an OA has been destroyed, which requires a retry in the case where an AdapterActivator is present.
-
exit
public void exit()
Description copied from interface:ObjectAdapter
exit must be called after each request has been completed. If enter is called and completes normally, there must always be a corresponding exit. If enter throw OADestroyed, exit must NOT be called.- Specified by:
exit
in interfaceObjectAdapter
- Specified by:
exit
in classObjectAdapterBase
-
connect
public void connect(Object objref)
Description copied from interface:TOA
Connect the given servant to the ORB by allocating a transient object key and creating an IOR and object reference using the current factory.
-
disconnect
public void disconnect(Object objref)
Description copied from interface:TOA
Disconnect the object from this ORB.- Specified by:
disconnect
in interfaceTOA
- Parameters:
objref
- ORB to disconnect from
-
-