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 TOAThe 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.Stringcodebaseprivate static java.util.concurrent.atomic.AtomicLongcurrentIdprivate longidprivate TransientObjectManagerservants-
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 voidconnect(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.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 java.lang.StringgetCodebase()PolicygetEffectivePolicy(int type)private longgetId()java.lang.String[]getInterfaces(java.lang.Object servant, byte[] objectId)Return the most derived interface for the given servant and objectId.voidgetInvocationServant(OAInvocationInfo info)Get the servant for the request given by the parameters.ObjectgetLocalServant(byte[] objectId)Get the servant corresponding to the given objectId, if this is supported.intgetManagerId()Return the ID of the AdapterManager for this object adapter.org.glassfish.pfl.dynamic.copyobject.spi.ObjectCopierFactorygetObjectCopierFactory()shortgetState()Return the current state of this object adapter (seeorg.omg.PortableInterceptorfor states).private TransientObjectManagergetTransientObjectManager()voidreturnServant()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:
getObjectCopierFactoryin classObjectAdapterBase
-
getLocalServant
public Object getLocalServant(byte[] objectId)
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
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:
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
public java.lang.String[] getInterfaces(java.lang.Object servant, byte[] objectId)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
public Policy getEffectivePolicy(int type)
- 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:
org.omg.PortableInterceptor
-
enter
public void enter() throws OADestroyedDescription 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
public void connect(Object objref)
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
public void disconnect(Object objref)
Description copied from interface:TOADisconnect the object from this ORB.- Specified by:
disconnectin interfaceTOA- Parameters:
objref- ORB to disconnect from
-
-