Package com.sun.corba.ee.impl.oa.poa
Class POAImpl
- java.lang.Object
-
- org.omg.CORBA.LocalObject
-
- com.sun.corba.ee.spi.oa.ObjectAdapterBase
-
- com.sun.corba.ee.impl.oa.poa.POAImpl
-
- All Implemented Interfaces:
ObjectAdapter
,java.io.Serializable
,Object
,IDLEntity
,POA
,POAOperations
@ManagedObject public class POAImpl extends ObjectAdapterBase implements POA
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:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
POAImpl.DestroyThread
-
Field Summary
Fields Modifier and Type Field Description private AdapterActivator
activator
private java.util.concurrent.locks.Condition
adapterActivatorCV
private java.util.concurrent.locks.Condition
beingDestroyedCV
private java.util.Map<java.lang.String,POAImpl>
children
private java.util.concurrent.atomic.AtomicInteger
invocationCount
private java.util.concurrent.locks.Condition
invokeCV
private java.lang.ThreadLocal<java.lang.Boolean>
isDestroying
private POAManagerImpl
manager
private POAPolicyMediator
mediator
private static java.lang.Object
momLock
private int
numLevels
private static OMGSystemException
omgWrapper
private POAImpl
parent
private ObjectAdapterId
poaId
(package private) java.util.concurrent.locks.ReadWriteLock
poaMutex
private java.lang.String
poaName
private static long
serialVersionUID
private int
state
private static int
STATE_DESTROYED
private static int
STATE_DESTROYING
private static int
STATE_INIT
private static int
STATE_INIT_DONE
private static int
STATE_RUN
private static int
STATE_START
private int
uniquePOAId
private static POASystemException
wrapper
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
acquireLock(java.util.concurrent.locks.Lock lock)
private void
acquireLockWaiting(int count)
byte[]
activate_object(Servant servant)
activate_object
Section 3.3.8.14void
activate_object_with_id(byte[] id, Servant servant)
activate_object_with_id
Section 3.3.8.15private void
adapterActivatorResult(boolean result)
private void
callingAdapterActivator()
private java.util.List<POAImpl>
children()
the_children
private void
cleanUpLocks(POAImpl child, boolean readLocked, boolean writeLocked, boolean childReadLocked)
IdAssignmentPolicy
create_id_assignment_policy(IdAssignmentPolicyValue value)
create_id_assignment_policy
Section 3.3.8.5IdUniquenessPolicy
create_id_uniqueness_policy(IdUniquenessPolicyValue value)
create_id_uniqueness_policy
Section 3.3.8.5ImplicitActivationPolicy
create_implicit_activation_policy(ImplicitActivationPolicyValue value)
create_implicit_activation_policy
Section 3.3.8.5LifespanPolicy
create_lifespan_policy(LifespanPolicyValue value)
create_lifespan_policy
Section 3.3.8.5POA
create_POA(java.lang.String name, POAManager theManager, Policy[] policies)
create_POA
Section 3.3.8.2Object
create_reference(java.lang.String repId)
create_reference
3.3.8.17Object
create_reference_with_id(byte[] oid, java.lang.String repId)
create_reference_with_id
3.3.8.18RequestProcessingPolicy
create_request_processing_policy(RequestProcessingPolicyValue value)
create_request_processing_policy
Section 3.3.8.5ServantRetentionPolicy
create_servant_retention_policy(ServantRetentionPolicyValue value)
create_servant_retention_policy
Section 3.3.8.5ThreadPolicy
create_thread_policy(ThreadPolicyValue value)
create_thread_policy
Section 3.3.8.5private void
createdPOA(POAImpl poa)
void
deactivate_object(byte[] id)
deactivate_object
3.3.8.16void
destroy(boolean etherealize, boolean wait_for_completion)
destroy
Section 3.3.8.4private boolean
destroyIfNotInitDone()
private void
doActivate(AdapterActivator act, java.lang.String name, POAImpl child)
void
enter()
enter must be called before each request is invoked on a servant.(package private) void
etherealizeAll()
void
exit()
exit must be called after each request has been completed.POA
find_POA(java.lang.String name, boolean activate)
find_POA
Section 3.3.8.3private void
foundPOA(POAImpl poa)
Servant
get_servant()
get_servant
Section 3.3.8.12ServantManager
get_servant_manager()
get_servant_manager
Section 3.3.8.10private java.lang.String
getDisplayState()
Policy
getEffectivePolicy(int type)
java.lang.String[]
getInterfaces(java.lang.Object servant, byte[] objectId)
Return the most derived interface for the given servant and objectId.private int
getInvocationCount()
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.(package private) POAPolicyMediator
getMediator()
private java.lang.String
getName()
private ObjectAdapterId
getObjectAdapterId()
protected org.glassfish.pfl.dynamic.copyobject.spi.ObjectCopierFactory
getObjectCopierFactory()
(package private) static POAFactory
getPOAFactory(ORB orb)
(package private) int
getPOAId()
private POAManagerImpl
getPOAManager()
(package private) Policies
getPolicies()
short
getState()
Return the current state of this object adapter (seeorg.omg.PortableInterceptor
for states).byte[]
id()
id
11.3.8.26 in ptc/00-08-06Object
id_to_reference(byte[] id)
id_to_reference
3.3.8.24Servant
id_to_servant(byte[] id)
id_to_servant
3.3.8.23private void
initialize(POAManagerImpl manager, Policies policies)
private void
initializingPoa(int scid, int serverid, java.lang.String orbid, ObjectAdapterId poaId)
private byte[]
internalReferenceToId(Object reference)
private void
interruptedAwait(java.lang.InterruptedException exc)
(package private) void
lock()
private void
lockAndWaitUntilRunning()
private void
locksWereHeld()
(package private) java.util.concurrent.locks.Condition
makeCondition()
(package private) static POAImpl
makeRootPOA(ORB orb)
private void
newPOA(POAImpl poa)
private void
newPOACreated(java.lang.String name, java.lang.String parentName)
private void
noPOA()
(package private) void
readLock()
(package private) void
readUnlock()
byte[]
reference_to_id(Object reference)
reference_to_id
3.3.8.22Servant
reference_to_servant(Object reference)
reference_to_servant
3.3.8.21private static void
registerMBean(ORB orb, java.lang.Object obj)
void
returnServant()
Called from the subcontract to let this POA cleanup after an invocation.private Servant
servant()
byte[]
servant_to_id(Servant servant)
servant_to_id
3.3.8.19Object
servant_to_reference(Servant servant)
servant_to_reference
3.3.8.20private ServantManager
servantManager()
void
set_servant(Servant defaultServant)
set_servant
Section 3.3.8.13void
set_servant_manager(ServantManager servantManager)
set_servant_manager
Section 3.3.8.10private java.lang.String
stateToString()
AdapterActivator
the_activator()
the_activator
Section 3.3.8.9void
the_activator(AdapterActivator activator)
the_activator
Section 3.3.8.9POA[]
the_children()
This attribute identifies the current set of all child POAs of the POA.java.lang.String
the_name()
the_name
Section 3.3.8.6POA
the_parent()
the_parent
Section 3.3.8.7POAManager
the_POAManager()
the_POAManager
Section 3.3.8.8private void
thisPoa(POAImpl p)
java.lang.String
toString()
(package private) void
unlock()
private boolean
waitUntilRunning()
-
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, wait, wait, wait
-
Methods 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 Detail
-
wrapper
private static final POASystemException wrapper
-
omgWrapper
private static final OMGSystemException omgWrapper
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
STATE_START
private static final int STATE_START
- See Also:
- Constant Field Values
-
STATE_INIT
private static final int STATE_INIT
- See Also:
- Constant Field Values
-
STATE_INIT_DONE
private static final int STATE_INIT_DONE
- See Also:
- Constant Field Values
-
STATE_RUN
private static final int STATE_RUN
- See Also:
- Constant Field Values
-
STATE_DESTROYING
private static final int STATE_DESTROYING
- See Also:
- Constant Field Values
-
STATE_DESTROYED
private static final int STATE_DESTROYED
- See Also:
- Constant Field Values
-
state
private int state
-
mediator
private POAPolicyMediator mediator
-
numLevels
private final int numLevels
-
poaId
private final ObjectAdapterId poaId
-
poaName
private final java.lang.String poaName
-
manager
private POAManagerImpl manager
-
uniquePOAId
private final int uniquePOAId
-
parent
private POAImpl parent
-
children
private final java.util.Map<java.lang.String,POAImpl> children
-
activator
private AdapterActivator activator
-
invocationCount
private final java.util.concurrent.atomic.AtomicInteger invocationCount
-
poaMutex
final java.util.concurrent.locks.ReadWriteLock poaMutex
-
adapterActivatorCV
private final java.util.concurrent.locks.Condition adapterActivatorCV
-
invokeCV
private final java.util.concurrent.locks.Condition invokeCV
-
beingDestroyedCV
private final java.util.concurrent.locks.Condition beingDestroyedCV
-
isDestroying
private final java.lang.ThreadLocal<java.lang.Boolean> isDestroying
-
momLock
private static final java.lang.Object momLock
-
-
Method Detail
-
stateToString
private java.lang.String stateToString()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getDisplayState
@ManagedAttribute(id="POAState") @Description("The current state of the POA") private java.lang.String getDisplayState()
-
getMediator
@ManagedAttribute @Description("The POA\'s mediator") POAPolicyMediator getMediator()
-
getObjectAdapterId
@ManagedAttribute @Description("The ObjectAdapterId for this POA") private ObjectAdapterId getObjectAdapterId()
-
getPOAFactory
static POAFactory getPOAFactory(ORB orb)
-
registerMBean
private static void registerMBean(ORB orb, java.lang.Object obj)
-
getPOAId
@ManagedAttribute @Description("The unique ID for this POA") int getPOAId()
-
thisPoa
@InfoMethod private void thisPoa(POAImpl p)
-
acquireLockWaiting
@InfoMethod private void acquireLockWaiting(int count)
-
acquireLock
private void acquireLock(java.util.concurrent.locks.Lock lock)
-
lock
void lock()
-
unlock
void unlock()
-
readLock
void readLock()
-
readUnlock
void readUnlock()
-
makeCondition
final java.util.concurrent.locks.Condition makeCondition()
-
getPolicies
Policies getPolicies()
-
newPOACreated
private void newPOACreated(java.lang.String name, java.lang.String parentName)
-
getName
@NameValue private java.lang.String getName()
-
initializingPoa
@InfoMethod private void initializingPoa(int scid, int serverid, java.lang.String orbid, ObjectAdapterId poaId)
-
initialize
private void initialize(POAManagerImpl manager, Policies policies)
-
interruptedAwait
@InfoMethod private void interruptedAwait(java.lang.InterruptedException exc)
-
waitUntilRunning
private boolean waitUntilRunning()
-
destroyIfNotInitDone
private boolean destroyIfNotInitDone()
-
internalReferenceToId
private byte[] internalReferenceToId(Object reference) throws WrongAdapter
- Throws:
WrongAdapter
-
etherealizeAll
void etherealizeAll()
-
newPOA
@InfoMethod private void newPOA(POAImpl poa)
-
create_POA
public POA create_POA(java.lang.String name, POAManager theManager, Policy[] policies) throws AdapterAlreadyExists, InvalidPolicy
create_POA
Section 3.3.8.2- Specified by:
create_POA
in 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.- Returns:
- the new POA
- Throws:
AdapterAlreadyExists
- specifies that the target POA already has a child POA with the specified name.InvalidPolicy
- is raised if any of the policy objects are not valid for the ORB, or are in conflict, or require an administrative action that has not been performed.
-
foundPOA
@InfoMethod private void foundPOA(POAImpl poa)
-
createdPOA
@InfoMethod private void createdPOA(POAImpl poa)
-
noPOA
@InfoMethod private void noPOA()
-
callingAdapterActivator
@InfoMethod private void callingAdapterActivator()
-
adapterActivatorResult
@InfoMethod private void adapterActivatorResult(boolean result)
-
find_POA
public POA find_POA(java.lang.String name, boolean activate) throws AdapterNonExistent
find_POA
Section 3.3.8.3- Specified by:
find_POA
in 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:
- org.omg.PortableServer.POAPackage.POA if one exists or is activated by the AdapterActivator.
- Throws:
AdapterNonExistent
- is raised if POA with a specified name cannot be found or activated using AdapaterActivator.
-
lockAndWaitUntilRunning
private void lockAndWaitUntilRunning()
-
doActivate
private void doActivate(AdapterActivator act, java.lang.String name, POAImpl child) throws AdapterNonExistent
- Throws:
AdapterNonExistent
-
locksWereHeld
@InfoMethod private void locksWereHeld()
-
cleanUpLocks
private void cleanUpLocks(POAImpl child, boolean readLocked, boolean writeLocked, boolean childReadLocked)
-
destroy
public void destroy(boolean etherealize, boolean wait_for_completion)
destroy
Section 3.3.8.4- Specified by:
destroy
in 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
public ThreadPolicy create_thread_policy(ThreadPolicyValue value)
create_thread_policy
Section 3.3.8.5- Specified by:
create_thread_policy
in interfacePOAOperations
- Parameters:
value
- policy type- Returns:
- ThreadPolcy Object
-
create_lifespan_policy
public LifespanPolicy create_lifespan_policy(LifespanPolicyValue value)
create_lifespan_policy
Section 3.3.8.5- Specified by:
create_lifespan_policy
in interfacePOAOperations
- Parameters:
value
- policy type- Returns:
- LifespanPolicy Object.
-
create_id_uniqueness_policy
public IdUniquenessPolicy create_id_uniqueness_policy(IdUniquenessPolicyValue value)
create_id_uniqueness_policy
Section 3.3.8.5- Specified by:
create_id_uniqueness_policy
in interfacePOAOperations
- Parameters:
value
- policy type- Returns:
- IdUniquenessPolicy Object.
-
create_id_assignment_policy
public IdAssignmentPolicy create_id_assignment_policy(IdAssignmentPolicyValue value)
create_id_assignment_policy
Section 3.3.8.5- Specified by:
create_id_assignment_policy
in interfacePOAOperations
- Parameters:
value
- policy type- Returns:
- IdAssignmentPolicy Object.
-
create_implicit_activation_policy
public ImplicitActivationPolicy create_implicit_activation_policy(ImplicitActivationPolicyValue value)
create_implicit_activation_policy
Section 3.3.8.5- Specified by:
create_implicit_activation_policy
in interfacePOAOperations
- Parameters:
value
- policy type- Returns:
- ImplicitActivationPolicy Object.
-
create_servant_retention_policy
public ServantRetentionPolicy create_servant_retention_policy(ServantRetentionPolicyValue value)
create_servant_retention_policy
Section 3.3.8.5- Specified by:
create_servant_retention_policy
in interfacePOAOperations
- Parameters:
value
- policy type- Returns:
- ServantRetentionPolicy Object.
-
create_request_processing_policy
public RequestProcessingPolicy create_request_processing_policy(RequestProcessingPolicyValue value)
create_request_processing_policy
Section 3.3.8.5- Specified by:
create_request_processing_policy
in interfacePOAOperations
- Parameters:
value
- policy type- Returns:
- RequestProcessingPolicy Object.
-
the_name
@ManagedAttribute(id="POAName") @Description("The name of this POA") public java.lang.String the_name()
the_name
Section 3.3.8.6- Specified by:
the_name
in interfacePOAOperations
- Returns:
- name of the POA
-
the_parent
@ManagedAttribute(id="POAParent") @Description("The parent of this POA") public POA the_parent()
the_parent
Section 3.3.8.7- Specified by:
the_parent
in interfacePOAOperations
- Returns:
- the parent of the POA
-
children
@ManagedAttribute(id="POAChildren") @Description("The children of this POA") private java.util.List<POAImpl> children()
the_children
-
the_children
public POA[] the_children()
Description copied from interface:POAOperations
This attribute identifies the current set of all child POAs of the POA. The set of child POAs includes only the POA's immediate children, and not their descendants.- Specified by:
the_children
in interfacePOAOperations
- Returns:
- the children of the POA
-
getPOAManager
@ManagedAttribute(id="POAManager") @Description("The POAManager of this POA") private POAManagerImpl getPOAManager()
-
the_POAManager
public POAManager the_POAManager()
the_POAManager
Section 3.3.8.8- Specified by:
the_POAManager
in interfacePOAOperations
- Returns:
- the POA manager
-
the_activator
@ManagedAttribute(id="Activator") @Description("The AdapterActivator of this POA") public AdapterActivator the_activator()
the_activator
Section 3.3.8.9- Specified by:
the_activator
in interfacePOAOperations
-
the_activator
public void the_activator(AdapterActivator activator)
the_activator
Section 3.3.8.9- Specified by:
the_activator
in interfacePOAOperations
-
get_servant_manager
public ServantManager get_servant_manager() throws WrongPolicy
get_servant_manager
Section 3.3.8.10- Specified by:
get_servant_manager
in interfacePOAOperations
- Returns:
- org.omg.PortableServer.POAPackage.ServantManager associated with a POA or null if none exists.
- Throws:
WrongPolicy
- raised if the USE_SERVANT_MANAGER policy is not specified.
-
servantManager
@ManagedAttribute @Description("The servant manager of this POA (may be null)") private ServantManager servantManager()
-
set_servant_manager
public void set_servant_manager(ServantManager servantManager) throws WrongPolicy
set_servant_manager
Section 3.3.8.10- Specified by:
set_servant_manager
in interfacePOAOperations
- Parameters:
servantManager
- servant manager to be used as a default.- Throws:
WrongPolicy
- raised if the USE_SERVANT_MANAGER policy is not specified.
-
get_servant
public Servant get_servant() throws NoServant, WrongPolicy
get_servant
Section 3.3.8.12- Specified by:
get_servant
in interfacePOAOperations
- Returns:
- p_servant default servant associated with a POA.
- Throws:
NoServant
- raised if no default servant is associated with the POA.WrongPolicy
- raised if the USE_DEFAULT_SERVANT policy is not specified.
-
servant
@ManagedAttribute @Description("The default servant of this POA (may be null)") private Servant servant()
-
set_servant
public void set_servant(Servant defaultServant) throws WrongPolicy
set_servant
Section 3.3.8.13- Specified by:
set_servant
in interfacePOAOperations
- Parameters:
defaultServant
- servant to be used as a default.- Throws:
WrongPolicy
- raised if the USE_DEFAULT_SERVANT policy is not specified.
-
activate_object
public byte[] activate_object(Servant servant) throws ServantAlreadyActive, WrongPolicy
activate_object
Section 3.3.8.14- Specified by:
activate_object
in interfacePOAOperations
- Parameters:
servant
- servant to be associated with an object to be activated.- Returns:
- POA generated object id.
- Throws:
ServantAlreadyActive
- is raised if the POA has UNIQUE_ID policy and servant is is already in the Active Object Map.WrongPolicy
- raised if the SYSTEM_ID and RETAIN policies are not specified.
-
activate_object_with_id
public void activate_object_with_id(byte[] id, Servant servant) throws ObjectAlreadyActive, ServantAlreadyActive, WrongPolicy
activate_object_with_id
Section 3.3.8.15- Specified by:
activate_object_with_id
in interfacePOAOperations
- Parameters:
id
- object id for the object to be activated.servant
- servant to be associated with the object.- Throws:
ObjectAlreadyActive
- raised if the object is already active in the POA.ServantAlreadyActive
- raised if the POA has the UNIQUE_ID policy and the servant is already in the Active Object Map.WrongPolicy
- raised if the RETAIN policy is is not specified.
-
deactivate_object
public void deactivate_object(byte[] id) throws ObjectNotActive, WrongPolicy
deactivate_object
3.3.8.16- Specified by:
deactivate_object
in interfacePOAOperations
- Parameters:
id
- Object Id for the object to be deactivated.- Throws:
ObjectNotActive
- if the object with the specified oid is not in the Active Object Map.WrongPolicy
- raised if the RETAIN policy is is not specified.
-
create_reference
public Object create_reference(java.lang.String repId) throws WrongPolicy
create_reference
3.3.8.17- Specified by:
create_reference
in interfacePOAOperations
- Parameters:
repId
- rep id for creating an object reference.- Returns:
- object reference created using intf.
- Throws:
WrongPolicy
- if SYSTEM_ID policy is not specified.
-
create_reference_with_id
public Object create_reference_with_id(byte[] oid, java.lang.String repId)
create_reference_with_id
3.3.8.18- Specified by:
create_reference_with_id
in 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
public byte[] servant_to_id(Servant servant) throws ServantNotActive, WrongPolicy
servant_to_id
3.3.8.19- Specified by:
servant_to_id
in interfacePOAOperations
- Parameters:
servant
- servant for which the object disi returned.- Returns:
- object id associated with the servant.
- Throws:
ServantNotActive
- if the above rules and policy combination is not met.WrongPolicy
- if the USE_DEFAULT_SERVANT policy or a combination of the RETAIN policy and either the UNIQUE_ID or IMPLICIT_ACTIVATION policies are not present.
-
servant_to_reference
public Object servant_to_reference(Servant servant) throws ServantNotActive, WrongPolicy
servant_to_reference
3.3.8.20- Specified by:
servant_to_reference
in interfacePOAOperations
- Parameters:
servant
- servant for which the object reference needs to be obtained.- Returns:
- object reference associated with the servant.
- Throws:
ServantNotActive
- if the above specified policies and rules are not met.WrongPolicy
- if the operation is not invoked in the context of executing a request on the specified servant and the required policies are not present.
-
reference_to_servant
public Servant reference_to_servant(Object reference) throws ObjectNotActive, WrongPolicy, WrongAdapter
reference_to_servant
3.3.8.21- Specified by:
reference_to_servant
in interfacePOAOperations
- Parameters:
reference
- object reference for which the servant is returned.- Returns:
- servant associated with the reference.
- Throws:
ObjectNotActive
- if the servant is not present in the Active Object Map (for RETAIN) or no default servant is registered (for USE_DEFAULT_POLICY).WrongPolicy
- if neither the RETAIN policy or the USE_DEFAULT_SERVANT policy is present.WrongAdapter
- if reference was not created by this POA instance.
-
reference_to_id
public byte[] reference_to_id(Object reference) throws WrongAdapter, WrongPolicy
reference_to_id
3.3.8.22- Specified by:
reference_to_id
in interfacePOAOperations
- Parameters:
reference
- the object reference from which the object id needs to be returned.- Returns:
- object id encapsulated in the reference.
- Throws:
WrongAdapter
- if the reference was not created by the POA specified in the reference.WrongPolicy
- declared to allow future extensions.
-
id_to_servant
public Servant id_to_servant(byte[] id) throws ObjectNotActive, WrongPolicy
id_to_servant
3.3.8.23- Specified by:
id_to_servant
in interfacePOAOperations
- Parameters:
id
- object id for the which the servant is returned.- Returns:
- servant associated with oid.
- Throws:
ObjectNotActive
- is raised if ObjectId is is not in the Active Object Map (for RETAIN policy), or no default servant is registered (for USE_DEFAULT_SERVANT policy).WrongPolicy
- is raised if the RETAIN policy or the USE_DEFAULT_SERVANT policy is not present.
-
id_to_reference
public Object id_to_reference(byte[] id) throws ObjectNotActive, WrongPolicy
id_to_reference
3.3.8.24- Specified by:
id_to_reference
in interfacePOAOperations
- Parameters:
id
- id of the object for which the reference is returned.- Returns:
- the object reference
- Throws:
ObjectNotActive
- if the Object Id value is not active in the POA.WrongPolicy
- if the RETAIN policy is not present.
-
id
public byte[] id()
id
11.3.8.26 in ptc/00-08-06- Specified by:
id
in interfacePOAOperations
- Returns:
- the unique id
-
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
-
getInterfaces
public java.lang.String[] getInterfaces(java.lang.Object servant, byte[] objectId)
Description copied from interface:ObjectAdapter
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
-
getObjectCopierFactory
protected org.glassfish.pfl.dynamic.copyobject.spi.ObjectCopierFactory getObjectCopierFactory()
- Specified by:
getObjectCopierFactory
in classObjectAdapterBase
-
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
-
getInvocationCount
@ManagedAttribute @Description("The current invocation count of this POA") private int getInvocationCount()
-
getInvocationServant
public void getInvocationServant(OAInvocationInfo info)
Description copied from interface:ObjectAdapter
Get 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:
getInvocationServant
in interfaceObjectAdapter
- Specified by:
getInvocationServant
in classObjectAdapterBase
- Parameters:
info
- is the InvocationInfo object for the object reference
-
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
-
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:
returnServant
in interfaceObjectAdapter
- Specified by:
returnServant
in classObjectAdapterBase
-
-