org.jacorb.poa

Class POA

public class POA extends _POALocalBase implements Configurable

The main POA class, an implementation of org.omg.PortableServer.POA

Version: $Id: POA.java,v 1.65 2006/07/13 08:46:37 nick.cross Exp $

Author: Reimo Tiedemann, FU Berlin

Field Summary
protected BidirectionalPolicybidirectionalPolicy
protected IdAssignmentPolicyidAssignmentPolicy
protected IdUniquenessPolicyidUniquenessPolicy
protected ImplicitActivationPolicyimplicitActivationPolicy
protected LifespanPolicylifespanPolicy
protected RequestProcessingPolicyrequestProcessingPolicy
protected ServantRetentionPolicyservantRetentionPolicy
protected SSLPolicysslPolicy
protected ThreadPolicythreadPolicy
Method Summary
byte[]activate_object(Servant servant)
voidactivate_object_with_id(byte[] oid, Servant servant)
voidaddLocalRequest()
protected voidaddPOAListener(POAListener listener)
protected voidchangeToActive()
protected voidchangeToDiscarding()
protected voidchangeToHolding()
protected voidchangeToInactive(boolean etherealize_objects)
protected voidcheckDestructionApparent()
protected static voidcheckNotLocal(Object obj)
voidconfigure(Configuration myConfiguration)
IdAssignmentPolicycreate_id_assignment_policy(IdAssignmentPolicyValue value)
IdUniquenessPolicycreate_id_uniqueness_policy(IdUniquenessPolicyValue value)
ImplicitActivationPolicycreate_implicit_activation_policy(ImplicitActivationPolicyValue value)
LifespanPolicycreate_lifespan_policy(LifespanPolicyValue value)
POAcreate_POA(String adapter_name, POAManager a_POAManager, Policy[] policies)
additionally raises an org.omg.CORBA.BAD_INV_ORDER exception if the poa goes shutdown and this method will called (not spec.)
Objectcreate_reference(String intf_rep_id)
The specified repository id, which may be a null string, will become the type_id of the generated object reference
Objectcreate_reference_with_id(byte[] oid, String intf_rep_id)
The specified repository id, which may be a null string, will become the type_id of the generated object reference
RequestProcessingPolicycreate_request_processing_policy(RequestProcessingPolicyValue value)
ServantRetentionPolicycreate_servant_retention_policy(ServantRetentionPolicyValue value)
ThreadPolicycreate_thread_policy(ThreadPolicyValue value)
voiddeactivate_object(byte[] oid)
The operation does not wait for requests or etherealization to complete and always returns immediately (after deactivating the oid?)
voiddestroy(boolean etherealize_objects, boolean wait_for_completion)
POAfind_POA(String adapter_name, boolean activate_it)
If the intended child poa is not found and activate_it is TRUE, it is possible for another thread to create the same poa with create_POA at the same time in a race condition.
protected POAMonitorgetMonitor()
intgetNumberOfObjects()
protected ORBgetORB()
PolicygetPolicy(int type)
byte[]getPOAId()
protected ObjectgetReference(byte[] oid, String intf_rep_id, boolean cache)
protected RequestControllergetRequestController()
protected StategetState()
Servantget_servant()
ServantManagerget_servant_manager()
Objectid_to_reference(byte[] oid)
Servantid_to_servant(byte[] oid)
protected booleanisActive()
protected booleanisDestructionApparent()
booleanisDestructionComplete()
isDestructionComplete returns whether the POA has been completely destroyed (including finishing outstanding requests).
protected booleanisDiscarding()
protected booleanisHolding()
protected booleanisImplicitActivation()
protected booleanisInactive()
protected booleanisMultipleId()
booleanisPersistent()
booleanisRetain()
also called from Delegate
protected booleanisShutdownInProgress()
protected booleanisSingleThreadModel()
booleanisSSLRequired()
booleanisSystemId()
protected booleanisUniqueId()
protected booleanisUseDefaultServant()
booleanisUseServantManager()
booleanpreviouslyGeneratedObjectId(byte[] oid)
booleanpreviouslyGeneratedObjectKey(byte[] object_key)
byte[]reference_to_id(Object reference)
Servantreference_to_servant(Object reference)
voidremoveLocalRequest()
protected voidremovePOAListener(POAListener listener)
byte[]servant_to_id(Servant servant)
Objectservant_to_reference(Servant servant)
protected voidsetMonitor(POAMonitor _monitor)
voidset_servant(Servant _defaultServant)
voidset_servant_manager(ServantManager servant_manager)
this method makes a additional check: if the POA has the RETAIN policy and _servantManager is not a instance of ServantActivator or if the POA has the NON_RETAIN policy and _servantManager is not a instance of ServantLocator this method raises also the WrongPolicy Exception (not spec.)
AdapterActivatorthe_activator()
it is system-dependent whether the root POA initially has an adapter activator. a newly created POA has not an adapter activator (null)
voidthe_activator(AdapterActivator adapter_activator)
POA[]the_children()
Stringthe_name()
POAthe_parent()
POAManagerthe_POAManager()
protected voidunregisterChild(String name)
notified the completion of a child destruction
booleanuseDefaultServant()
called from Delegate
protected booleanuseServantManager()
void_addPOAEventListener(EventListener listener)
Everybody who is interested in poa events can use this method to register an event listener.
POA_getChildPOA(String adapter_name)
called from orb, returns a registered child poa, if no child poa exists a adapter activator will used to create a new poa unter this name
String_getQualifiedName()
returns the complete poa name
Servant_incarnateServant(byte[] oid, ServantActivator sa)
Called from Delegate.
void_invoke(ServerRequest request)
called from orb for handing over a request
static POA_POA_init(ORB orb)
called from orb to obtain the RootPOA
void_removePOAEventListener(EventListener listener)
Unregister an event listener.

Field Detail

bidirectionalPolicy

protected BidirectionalPolicy bidirectionalPolicy

idAssignmentPolicy

protected IdAssignmentPolicy idAssignmentPolicy

idUniquenessPolicy

protected IdUniquenessPolicy idUniquenessPolicy

implicitActivationPolicy

protected ImplicitActivationPolicy implicitActivationPolicy

lifespanPolicy

protected LifespanPolicy lifespanPolicy

requestProcessingPolicy

protected RequestProcessingPolicy requestProcessingPolicy

servantRetentionPolicy

protected ServantRetentionPolicy servantRetentionPolicy

sslPolicy

protected SSLPolicy sslPolicy

threadPolicy

protected ThreadPolicy threadPolicy

Method Detail

activate_object

public byte[] activate_object(Servant servant)

activate_object_with_id

public void activate_object_with_id(byte[] oid, Servant servant)

addLocalRequest

public void addLocalRequest()

addPOAListener

protected void addPOAListener(POAListener listener)

changeToActive

protected void changeToActive()

changeToDiscarding

protected void changeToDiscarding()

changeToHolding

protected void changeToHolding()

changeToInactive

protected void changeToInactive(boolean etherealize_objects)

checkDestructionApparent

protected void checkDestructionApparent()

checkNotLocal

protected static void checkNotLocal(Object obj)

configure

public void configure(Configuration myConfiguration)

create_id_assignment_policy

public IdAssignmentPolicy create_id_assignment_policy(IdAssignmentPolicyValue value)

create_id_uniqueness_policy

public IdUniquenessPolicy create_id_uniqueness_policy(IdUniquenessPolicyValue value)

create_implicit_activation_policy

public ImplicitActivationPolicy create_implicit_activation_policy(ImplicitActivationPolicyValue value)

create_lifespan_policy

public LifespanPolicy create_lifespan_policy(LifespanPolicyValue value)

create_POA

public POA create_POA(String adapter_name, POAManager a_POAManager, Policy[] policies)
additionally raises an org.omg.CORBA.BAD_INV_ORDER exception if the poa goes shutdown and this method will called (not spec.)

create_reference

public Object create_reference(String intf_rep_id)
The specified repository id, which may be a null string, will become the type_id of the generated object reference

create_reference_with_id

public Object create_reference_with_id(byte[] oid, String intf_rep_id)
The specified repository id, which may be a null string, will become the type_id of the generated object reference

create_request_processing_policy

public RequestProcessingPolicy create_request_processing_policy(RequestProcessingPolicyValue value)

create_servant_retention_policy

public ServantRetentionPolicy create_servant_retention_policy(ServantRetentionPolicyValue value)

create_thread_policy

public ThreadPolicy create_thread_policy(ThreadPolicyValue value)

deactivate_object

public void deactivate_object(byte[] oid)
The operation does not wait for requests or etherealization to complete and always returns immediately (after deactivating the oid?)

destroy

public void destroy(boolean etherealize_objects, boolean wait_for_completion)

find_POA

public POA find_POA(String adapter_name, boolean activate_it)
If the intended child poa is not found and activate_it is TRUE, it is possible for another thread to create the same poa with create_POA at the same time in a race condition. Applications should be prepared to deal with failures from the manual (create_POA) or automatic (findPOA or unknown_adapter from AdapterActivator) POA creation. Another possible situation is that the poa returned goes shutdown but the orb will notice this situation if he will proceed with request processing.

getMonitor

protected POAMonitor getMonitor()

getNumberOfObjects

public int getNumberOfObjects()

getORB

protected ORB getORB()

getPolicy

public Policy getPolicy(int type)

getPOAId

public byte[] getPOAId()

getReference

protected Object getReference(byte[] oid, String intf_rep_id, boolean cache)

getRequestController

protected RequestController getRequestController()

getState

protected State getState()

get_servant

public Servant get_servant()

get_servant_manager

public ServantManager get_servant_manager()

id_to_reference

public Object id_to_reference(byte[] oid)

id_to_servant

public Servant id_to_servant(byte[] oid)

isActive

protected boolean isActive()

isDestructionApparent

protected boolean isDestructionApparent()

isDestructionComplete

public boolean isDestructionComplete()
isDestructionComplete returns whether the POA has been completely destroyed (including finishing outstanding requests). This is public not protected as it is called from orb/Delegate.

Returns: a boolean value.

isDiscarding

protected boolean isDiscarding()

isHolding

protected boolean isHolding()

isImplicitActivation

protected boolean isImplicitActivation()

isInactive

protected boolean isInactive()

isMultipleId

protected boolean isMultipleId()

isPersistent

public boolean isPersistent()

isRetain

public boolean isRetain()
also called from Delegate

isShutdownInProgress

protected boolean isShutdownInProgress()

isSingleThreadModel

protected boolean isSingleThreadModel()

isSSLRequired

public boolean isSSLRequired()

isSystemId

public boolean isSystemId()

isUniqueId

protected boolean isUniqueId()

isUseDefaultServant

protected boolean isUseDefaultServant()

isUseServantManager

public boolean isUseServantManager()

previouslyGeneratedObjectId

public boolean previouslyGeneratedObjectId(byte[] oid)

previouslyGeneratedObjectKey

public boolean previouslyGeneratedObjectKey(byte[] object_key)

reference_to_id

public byte[] reference_to_id(Object reference)

reference_to_servant

public Servant reference_to_servant(Object reference)

removeLocalRequest

public void removeLocalRequest()

removePOAListener

protected void removePOAListener(POAListener listener)

servant_to_id

public byte[] servant_to_id(Servant servant)

servant_to_reference

public Object servant_to_reference(Servant servant)

setMonitor

protected void setMonitor(POAMonitor _monitor)

set_servant

public void set_servant(Servant _defaultServant)

set_servant_manager

public void set_servant_manager(ServantManager servant_manager)
this method makes a additional check: if the POA has the RETAIN policy and _servantManager is not a instance of ServantActivator or if the POA has the NON_RETAIN policy and _servantManager is not a instance of ServantLocator this method raises also the WrongPolicy Exception (not spec.)

the_activator

public AdapterActivator the_activator()
it is system-dependent whether the root POA initially has an adapter activator. a newly created POA has not an adapter activator (null)

the_activator

public void the_activator(AdapterActivator adapter_activator)

the_children

public POA[] the_children()

the_name

public String the_name()

the_parent

public POA the_parent()

the_POAManager

public POAManager the_POAManager()

unregisterChild

protected void unregisterChild(String name)
notified the completion of a child destruction

useDefaultServant

public boolean useDefaultServant()
called from Delegate

useServantManager

protected boolean useServantManager()

_addPOAEventListener

public void _addPOAEventListener(EventListener listener)
Everybody who is interested in poa events can use this method to register an event listener. The poa will pass the register calls to the right components

_getChildPOA

public POA _getChildPOA(String adapter_name)
called from orb, returns a registered child poa, if no child poa exists a adapter activator will used to create a new poa unter this name

_getQualifiedName

public String _getQualifiedName()
returns the complete poa name

_incarnateServant

public Servant _incarnateServant(byte[] oid, ServantActivator sa)
Called from Delegate. To ensure thread safety we use the AOM::incarnate method when activating a servant with the ServantActivator.

_invoke

public void _invoke(ServerRequest request)
called from orb for handing over a request

_POA_init

public static POA _POA_init(ORB orb)
called from orb to obtain the RootPOA

_removePOAEventListener

public void _removePOAEventListener(EventListener listener)
Unregister an event listener. The poa will pass the unregister calls to the right components