Package com.sun.corba.se.impl.oa.poa
Class POAImpl
java.lang.Object
org.omg.CORBA.LocalObject
com.sun.corba.se.spi.oa.ObjectAdapterBase
com.sun.corba.se.impl.oa.poa.POAImpl
- All Implemented Interfaces:
ObjectAdapter,Serializable,Object,IDLEntity,POA,POAOperations
POAImpl is the implementation of the Portable Object Adapter. It
contains an implementation of the POA interfaces specified in
COBRA 2.3.1 chapter 11 (formal/99-10-07). This implementation
is moving to comply with CORBA 3.0 due to the many clarifications
that have been made to the POA semantics since CORBA 2.3.1.
Specific comments have been added where 3.0 applies, but note that
we do not have the new 3.0 APIs yet.
- See Also:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbyte[]activate_object(Servant servant) activate_objectSection 3.3.8.14voidactivate_object_with_id(byte[] id, Servant servant) activate_object_with_idSection 3.3.8.15create_id_assignment_policySection 3.3.8.5create_id_uniqueness_policySection 3.3.8.5create_implicit_activation_policySection 3.3.8.5create_lifespan_policySection 3.3.8.5create_POA(String name, POAManager theManager, Policy[] policies) create_POASection 3.3.8.2create_reference(String repId) create_reference3.3.8.17create_reference_with_id(byte[] oid, String repId) create_reference_with_id3.3.8.18create_request_processing_policySection 3.3.8.5create_servant_retention_policySection 3.3.8.5create_thread_policySection 3.3.8.5voiddeactivate_object(byte[] id) deactivate_object3.3.8.16voiddestroy(boolean etherealize, boolean wait_for_completion) destroySection 3.3.8.4voidenter()enter must be called before each request is invoked on a servant.voidexit()exit must be called after each request has been completed.find_POASection 3.3.8.3get_servantSection 3.3.8.12get_servant_managerSection 3.3.8.10getEffectivePolicy(int type) 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.protected ObjectCopierFactoryshortgetState()Return the current state of this object adapter (see org.omg.PortableInterceptors for states.byte[]id()id11.3.8.26 in ptc/00-08-06id_to_reference(byte[] id) id_to_reference3.3.8.24id_to_servant(byte[] id) id_to_servant3.3.8.23byte[]reference_to_id(Object reference) reference_to_id3.3.8.22reference_to_servant(Object reference) reference_to_servant3.3.8.21voidCalled from the subcontract to let this POA cleanup after an invocation.byte[]servant_to_id(Servant servant) servant_to_id3.3.8.19servant_to_reference(Servant servant) servant_to_reference3.3.8.20voidset_servant(Servant defaultServant) set_servantSection 3.3.8.13voidset_servant_manager(ServantManager servantManager) set_servant_managerSection 3.3.8.10the_activatorSection 3.3.8.9voidthe_activator(AdapterActivator activator) the_activatorSection 3.3.8.9POA[]the_childrenthe_name()the_nameSection 3.3.8.6the_parentSection 3.3.8.7the_POAManagerSection 3.3.8.8toString()Methods inherited from class com.sun.corba.se.spi.oa.ObjectAdapterBase
getAdapterId, getAdapterTemplate, getCurrentFactory, getIORTemplate, getORB, initializeTemplate, invocationWrapper, iorWrapper, lifecycleWrapper, makeInvocationInfo, makeObject, omgInvocationWrapper, omgLifecycleWrapper, setCurrentFactoryMethods 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_connectionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.omg.CORBA.Object
_create_request, _create_request, _duplicate, _get_domain_managers, _get_interface_def, _get_policy, _hash, _is_a, _is_equivalent, _non_existent, _release, _request, _set_policy_override
-
Field Details
-
isDestroying
-
-
Method Details
-
toString
-
create_POA
public POA create_POA(String name, POAManager theManager, Policy[] policies) throws AdapterAlreadyExists, InvalidPolicy create_POASection 3.3.8.2- Specified by:
create_POAin interfacePOAOperations- Parameters:
name- identifies the new POA with respect to other POAs with the same parent POA.theManager- specifies the POA Manager to be associated with the new POA.policies- specifies policy objects to be associated with the POA to control its behavior.- Throws:
AdapterAlreadyExistsInvalidPolicy
-
find_POA
find_POASection 3.3.8.3- Specified by:
find_POAin interfacePOAOperations- Parameters:
name- POA name to be found.activate- if a POA with the specified name does not exist and the value of the activate_it parameter is TRUE, the target POA's AdapterActivator, if one exists, is invoked.- Returns:
- POA if one exists or is activated by the AdapterActivator.
- Throws:
AdapterNonExistent
-
destroy
public void destroy(boolean etherealize, boolean wait_for_completion) destroySection 3.3.8.4- Specified by:
destroyin interfacePOAOperations- Parameters:
etherealize- flag to indicate whether etherealize operation on servant manager needs to be called.wait_for_completion- flag to indicate whether POA and its children need to wait for active requests and the etherealization to complete.
-
create_thread_policy
create_thread_policySection 3.3.8.5- Specified by:
create_thread_policyin interfacePOAOperations- Parameters:
value- policy type- Returns:
- ThreadPolcy Object
-
create_lifespan_policy
create_lifespan_policySection 3.3.8.5- Specified by:
create_lifespan_policyin interfacePOAOperations- Parameters:
value- policy type- Returns:
- LifespanPolicy Object.
-
create_id_uniqueness_policy
create_id_uniqueness_policySection 3.3.8.5- Specified by:
create_id_uniqueness_policyin interfacePOAOperations- Parameters:
value- policy type- Returns:
- IdUniquenessPolicy Object.
-
create_id_assignment_policy
create_id_assignment_policySection 3.3.8.5- Specified by:
create_id_assignment_policyin interfacePOAOperations- Parameters:
value- policy type- Returns:
- IdAssignmentPolicy Object.
-
create_implicit_activation_policy
public ImplicitActivationPolicy create_implicit_activation_policy(ImplicitActivationPolicyValue value) create_implicit_activation_policySection 3.3.8.5- Specified by:
create_implicit_activation_policyin interfacePOAOperations- Parameters:
value- policy type- Returns:
- ImplicitActivationPolicy Object.
-
create_servant_retention_policy
create_servant_retention_policySection 3.3.8.5- Specified by:
create_servant_retention_policyin interfacePOAOperations- Parameters:
value- policy type- Returns:
- ServantRetentionPolicy Object.
-
create_request_processing_policy
create_request_processing_policySection 3.3.8.5- Specified by:
create_request_processing_policyin interfacePOAOperations- Parameters:
value- policy type- Returns:
- RequestProcessingPolicy Object.
-
the_name
the_nameSection 3.3.8.6- Specified by:
the_namein interfacePOAOperations
-
the_parent
the_parentSection 3.3.8.7- Specified by:
the_parentin interfacePOAOperations
-
the_children
the_children- Specified by:
the_childrenin interfacePOAOperations
-
the_POAManager
the_POAManagerSection 3.3.8.8- Specified by:
the_POAManagerin interfacePOAOperations
-
the_activator
the_activatorSection 3.3.8.9- Specified by:
the_activatorin interfacePOAOperations
-
the_activator
the_activatorSection 3.3.8.9- Specified by:
the_activatorin interfacePOAOperations
-
get_servant_manager
get_servant_managerSection 3.3.8.10- Specified by:
get_servant_managerin interfacePOAOperations- Returns:
- ServantManager associated with a POA or null if none exists.
- Throws:
WrongPolicy
-
set_servant_manager
set_servant_managerSection 3.3.8.10- Specified by:
set_servant_managerin interfacePOAOperations- Parameters:
servantManager- servant manager to be used as a default.- Throws:
WrongPolicy
-
get_servant
get_servantSection 3.3.8.12- Specified by:
get_servantin interfacePOAOperations- Returns:
- p_servant default servant associated with a POA.
- Throws:
NoServantWrongPolicy
-
set_servant
set_servantSection 3.3.8.13- Specified by:
set_servantin interfacePOAOperations- Parameters:
defaultServant- servant to be used as a default.- Throws:
WrongPolicy
-
activate_object
activate_objectSection 3.3.8.14- Specified by:
activate_objectin interfacePOAOperations- Parameters:
servant- servant to be associated with an object to be activated.- Returns:
- POA generated object id.
- Throws:
ServantAlreadyActiveWrongPolicy
-
activate_object_with_id
public void activate_object_with_id(byte[] id, Servant servant) throws ObjectAlreadyActive, ServantAlreadyActive, WrongPolicy activate_object_with_idSection 3.3.8.15- Specified by:
activate_object_with_idin interfacePOAOperations- Parameters:
id- object id for the object to be activated.servant- servant to be associated with the object.- Throws:
ObjectAlreadyActiveServantAlreadyActiveWrongPolicy
-
deactivate_object
deactivate_object3.3.8.16- Specified by:
deactivate_objectin interfacePOAOperations- Parameters:
id- Object Id for the object to be deactivated.- Throws:
ObjectNotActiveWrongPolicy
-
create_reference
create_reference3.3.8.17- Specified by:
create_referencein interfacePOAOperations- Parameters:
repId- rep id for creating an object reference.- Returns:
- object reference created using intf.
- Throws:
WrongPolicy
-
create_reference_with_id
create_reference_with_id3.3.8.18- Specified by:
create_reference_with_idin interfacePOAOperations- Parameters:
oid- object id for creating an objrefrepId- rep id for creating an objref- Returns:
- object reference created using oid and intf
-
servant_to_id
servant_to_id3.3.8.19- Specified by:
servant_to_idin interfacePOAOperations- Parameters:
servant- servant for which the object disi returned.- Returns:
- object id associated with the servant.
- Throws:
ServantNotActiveWrongPolicy
-
servant_to_reference
servant_to_reference3.3.8.20- Specified by:
servant_to_referencein interfacePOAOperations- Parameters:
servant- servant for which the object reference needs to be obtained.- Returns:
- object reference associated with the servant.
- Throws:
ServantNotActiveWrongPolicy
-
reference_to_servant
public Servant reference_to_servant(Object reference) throws ObjectNotActive, WrongPolicy, WrongAdapter reference_to_servant3.3.8.21- Specified by:
reference_to_servantin interfacePOAOperations- Parameters:
reference- object reference for which the servant is returned.- Returns:
- servant associated with the reference.
- Throws:
ObjectNotActiveWrongPolicyWrongAdapter
-
reference_to_id
reference_to_id3.3.8.22- Specified by:
reference_to_idin interfacePOAOperations- Parameters:
reference- the object reference from which the object id needs to be returned.- Returns:
- object id encapsulated in the reference.
- Throws:
WrongAdapterWrongPolicy
-
id_to_servant
id_to_servant3.3.8.23- Specified by:
id_to_servantin interfacePOAOperations- Parameters:
id- object id for the which the servant is returned.- Returns:
- servant associated with oid.
- Throws:
ObjectNotActiveWrongPolicy
-
id_to_reference
id_to_reference3.3.8.24- Specified by:
id_to_referencein interfacePOAOperations- Parameters:
id- id of the object for which the reference is returned.- Returns:
- the object reference
- Throws:
ObjectNotActiveWrongPolicy
-
id
public byte[] id()id11.3.8.26 in ptc/00-08-06- Specified by:
idin interfacePOAOperations
-
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
-
getState
public short getState()Description copied from interface:ObjectAdapterReturn the current state of this object adapter (see org.omg.PortableInterceptors for states.- Specified by:
getStatein interfaceObjectAdapter- Specified by:
getStatein classObjectAdapterBase
-
getInterfaces
Description copied from interface:ObjectAdapterReturn the most derived interface for the given servant and objectId.- Specified by:
getInterfacesin interfaceObjectAdapter- Specified by:
getInterfacesin classObjectAdapterBase
-
getObjectCopierFactory
- Specified by:
getObjectCopierFactoryin classObjectAdapterBase
-
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, there must always be a corresponding exit.- Specified by:
exitin interfaceObjectAdapter- Specified by:
exitin classObjectAdapterBase
-
getInvocationServant
Description copied from interface:ObjectAdapterGet the servant for the request given by the parameters. info must contain a valid objectId in this call. The servant is set in the InvocationInfo argument that is passed into this call.- Specified by:
getInvocationServantin interfaceObjectAdapter- Specified by:
getInvocationServantin classObjectAdapterBase- Parameters:
info- is the InvocationInfo object for the object reference
-
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
-
returnServant
public void returnServant()Called from the subcontract to let this POA cleanup after an invocation. Note: If getServant was called, then returnServant MUST be called, even in the case of exceptions. This may be called multiple times for a single request.- Specified by:
returnServantin interfaceObjectAdapter- Specified by:
returnServantin classObjectAdapterBase
-