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
FieldsModifier and TypeFieldDescriptionprivate Stringprivate static AtomicLongprivate longprivate TransientObjectManagerFields inherited from class ObjectAdapterBase
wrapper -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidConnect the given servant to the ORB by allocating a transient object key and creating an IOR and object reference using the current factory.voiddisconnect(Object objref) Disconnect the object from this ORB.voidenter()enter must be called before each request is invoked on a servant.voidexit()exit must be called after each request has been completed.private StringgetEffectivePolicy(int type) private longgetId()String[]getInterfaces(Object servant, byte[] objectId) Return the most derived interface for the given servant and objectId.voidGet the servant for the request given by the parameters.getLocalServant(byte[] objectId) Get the servant corresponding to the given objectId, if this is supported.intReturn the ID of the AdapterManager for this object adapter.org.glassfish.pfl.dynamic.copyobject.spi.ObjectCopierFactoryshortgetState()Return the current state of this object adapter (seeorg.omg.PortableInterceptorfor states).private TransientObjectManagervoidMust be called every time getInvocationServant is called after the request has completed.Methods inherited from class ObjectAdapterBase
getAdapterId, getAdapterTemplate, getCurrentFactory, getIORTemplate, getORB, initializeTemplate, isNameService, makeInvocationInfo, makeObject, setCurrentFactory, setNameService, wrapperMethods inherited from class 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_connectionMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ObjectAdapter
getAdapterTemplate, getCurrentFactory, getIORTemplate, getORB, isNameService, makeInvocationInfo, setCurrentFactory, setNameService
-
Field Details
-
currentId
-
servants
-
id
private long id -
codebase
-
-
Constructor Details
-
TOAImpl
-
-
Method Details
-
getId
@NameValue private long getId() -
getCodebase
-
getTransientObjectManager
@ManagedAttribute @Description("The TransientObjectManager") private TransientObjectManager getTransientObjectManager() -
getObjectCopierFactory
public org.glassfish.pfl.dynamic.copyobject.spi.ObjectCopierFactory getObjectCopierFactory()- Specified by:
getObjectCopierFactoryin classObjectAdapterBase
-
getLocalServant
Description copied from interface:ObjectAdapterGet 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:
getLocalServantin interfaceObjectAdapter- Specified by:
getLocalServantin classObjectAdapterBase- Parameters:
objectId- byte array representing the object ID- Returns:
- corresponding servant
-
getInvocationServant
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:
getInvocationServantin interfaceObjectAdapter- Specified by:
getInvocationServantin classObjectAdapterBase- Parameters:
info- is the request containing the rest of the request
-
returnServant
public void returnServant()Description copied from interface:ObjectAdapterMust be called every time getInvocationServant is called after the request has completed.- Specified by:
returnServantin interfaceObjectAdapter- Specified by:
returnServantin classObjectAdapterBase
-
getInterfaces
Return the most derived interface for the given servant and objectId.- Specified by:
getInterfacesin interfaceObjectAdapter- Specified by:
getInterfacesin classObjectAdapterBase- Parameters:
servant- servant objectobjectId- byte array forming the objectId- Returns:
- list of derived interfaces
-
getEffectivePolicy
- Specified by:
getEffectivePolicyin interfaceObjectAdapter- Specified by:
getEffectivePolicyin classObjectAdapterBase
-
getManagerId
public int getManagerId()Description copied from interface:ObjectAdapterReturn the ID of the AdapterManager for this object adapter.- Specified by:
getManagerIdin interfaceObjectAdapter- Specified by:
getManagerIdin classObjectAdapterBase- Returns:
- the identifier
-
getState
public short getState()Description copied from interface:ObjectAdapterReturn the current state of this object adapter (seeorg.omg.PortableInterceptorfor states).- Specified by:
getStatein interfaceObjectAdapter- Specified by:
getStatein classObjectAdapterBase- Returns:
- the current state of this object adapter
- See Also:
-
enter
Description copied from interface:ObjectAdapterenter must be called before each request is invoked on a servant.- Specified by:
enterin interfaceObjectAdapter- Specified by:
enterin 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:ObjectAdapterexit 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:
exitin interfaceObjectAdapter- Specified by:
exitin classObjectAdapterBase
-
connect
Description copied from interface:TOAConnect the given servant to the ORB by allocating a transient object key and creating an IOR and object reference using the current factory. -
disconnect
Description copied from interface:TOADisconnect the object from this ORB.- Specified by:
disconnectin interfaceTOA- Parameters:
objref- ORB to disconnect from
-