org.jacorb.poa
Class POA

java.lang.Object
  extended byorg.omg.CORBA.LocalObject
      extended byorg.omg.PortableServer._POALocalBase
          extended byorg.jacorb.poa.POA
All Implemented Interfaces:
org.apache.avalon.framework.configuration.Configurable, IDLEntity, LocalInterface, Object, POA, POAOperations, java.io.Serializable

public class POA
extends _POALocalBase
implements org.apache.avalon.framework.configuration.Configurable

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

Version:
$Id: POA.java,v 1.56 2006/05/09 14:47:55 alphonse.bendt Exp $
Author:
Reimo Tiedemann, FU Berlin
See Also:
Serialized Form

Field Summary
protected  BidirectionalPolicy bidirectionalPolicy
           
protected  IdAssignmentPolicy idAssignmentPolicy
           
protected  IdUniquenessPolicy idUniquenessPolicy
           
protected  ImplicitActivationPolicy implicitActivationPolicy
           
protected  LifespanPolicy lifespanPolicy
           
protected  RequestProcessingPolicy requestProcessingPolicy
           
protected  ServantRetentionPolicy servantRetentionPolicy
           
protected  org.jacorb.ssl.SSLPolicy sslPolicy
           
protected  ThreadPolicy threadPolicy
           
 
Method Summary
 void _addPOAEventListener(EventListener listener)
          Everybody who is interested in poa events can use this method to register an event listener.
 POA _getChildPOA(java.lang.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
 java.lang.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.
 void activate_object_with_id(byte[] oid, Servant servant)
           
 byte[] activate_object(Servant servant)
           
 void addLocalRequest()
           
protected  void addPOAListener(POAListener listener)
           
protected  void changeToActive()
           
protected  void changeToDiscarding()
           
protected  void changeToHolding()
           
protected  void changeToInactive(boolean etherealize_objects)
           
protected  void checkDestructionApparent()
           
protected static void checkNotLocal(Object obj)
           
 void configure(org.apache.avalon.framework.configuration.Configuration myConfiguration)
           
 IdAssignmentPolicy create_id_assignment_policy(IdAssignmentPolicyValue value)
           
 IdUniquenessPolicy create_id_uniqueness_policy(IdUniquenessPolicyValue value)
           
 ImplicitActivationPolicy create_implicit_activation_policy(ImplicitActivationPolicyValue value)
           
 LifespanPolicy create_lifespan_policy(LifespanPolicyValue value)
           
 POA create_POA(java.lang.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.)
 Object create_reference_with_id(byte[] oid, java.lang.String intf_rep_id)
          The specified repository id, which may be a null string, will become the type_id of the generated object reference
 Object create_reference(java.lang.String intf_rep_id)
          The specified repository id, which may be a null string, will become the type_id of the generated object reference
 RequestProcessingPolicy create_request_processing_policy(RequestProcessingPolicyValue value)
           
 ServantRetentionPolicy create_servant_retention_policy(ServantRetentionPolicyValue value)
           
 ThreadPolicy create_thread_policy(ThreadPolicyValue value)
           
 void deactivate_object(byte[] oid)
          The operation does not wait for requests or etherealization to complete and always returns immediately (after deactivating the oid?)
 void destroy(boolean etherealize_objects, boolean wait_for_completion)
           
 POA find_POA(java.lang.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.
 ServantManager get_servant_manager()
           
 Servant get_servant()
           
protected  POAMonitor getMonitor()
           
 int getNumberOfObjects()
           
protected  ORB getORB()
           
 byte[] getPOAId()
           
 Policy getPolicy(int type)
           
protected  Object getReference(byte[] oid, java.lang.String intf_rep_id, boolean cache)
           
protected  RequestController getRequestController()
           
protected  State getState()
           
 Object id_to_reference(byte[] oid)
           
 Servant id_to_servant(byte[] oid)
           
protected  boolean isActive()
           
protected  boolean isDestructionApparent()
           
protected  boolean isDestructionComplete()
           
protected  boolean isDiscarding()
           
protected  boolean isHolding()
           
protected  boolean isImplicitActivation()
           
protected  boolean isInactive()
           
protected  boolean isMultipleId()
           
 boolean isPersistent()
           
 boolean isRetain()
          also called from Delegate
protected  boolean isShutdownInProgress()
           
protected  boolean isSingleThreadModel()
           
 boolean isSSLRequired()
           
 boolean isSystemId()
           
protected  boolean isUniqueId()
           
protected  boolean isUseDefaultServant()
           
 boolean isUseServantManager()
           
 boolean previouslyGeneratedObjectId(byte[] oid)
           
 boolean previouslyGeneratedObjectKey(byte[] object_key)
           
 byte[] reference_to_id(Object reference)
           
 Servant reference_to_servant(Object reference)
           
 void removeLocalRequest()
           
protected  void removePOAListener(POAListener listener)
           
 byte[] servant_to_id(Servant servant)
           
 Object servant_to_reference(Servant servant)
           
 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.)
 void set_servant(Servant _defaultServant)
           
protected  void setMonitor(POAMonitor _monitor)
           
 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)
 void the_activator(AdapterActivator adapter_activator)
           
 POA[] the_children()
           
 java.lang.String the_name()
           
 POA the_parent()
           
 POAManager the_POAManager()
           
protected  void unregisterChild(java.lang.String name)
          notified the completion of a child destruction
 boolean useDefaultServant()
          called from Delegate
protected  boolean useServantManager()
           
 
Methods inherited from class org.omg.PortableServer._POALocalBase
_ids
 
Methods inherited from class org.omg.CORBA.LocalObject
_create_request, _create_request, _duplicate, _get_domain_managers, _get_interface_def, _get_interface, _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 org.omg.CORBA.Object
_create_request, _create_request, _duplicate, _get_domain_managers, _get_interface_def, _get_interface, _get_policy, _hash, _is_a, _is_equivalent, _non_existent, _release, _request, _set_policy_override
 

Field Detail

threadPolicy

protected ThreadPolicy threadPolicy

lifespanPolicy

protected LifespanPolicy lifespanPolicy

idUniquenessPolicy

protected IdUniquenessPolicy idUniquenessPolicy

idAssignmentPolicy

protected IdAssignmentPolicy idAssignmentPolicy

servantRetentionPolicy

protected ServantRetentionPolicy servantRetentionPolicy

requestProcessingPolicy

protected RequestProcessingPolicy requestProcessingPolicy

implicitActivationPolicy

protected ImplicitActivationPolicy implicitActivationPolicy

bidirectionalPolicy

protected BidirectionalPolicy bidirectionalPolicy

sslPolicy

protected org.jacorb.ssl.SSLPolicy sslPolicy
Method Detail

configure

public void configure(org.apache.avalon.framework.configuration.Configuration myConfiguration)
               throws org.apache.avalon.framework.configuration.ConfigurationException
Specified by:
configure in interface org.apache.avalon.framework.configuration.Configurable
Throws:
org.apache.avalon.framework.configuration.ConfigurationException

_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


_incarnateServant

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

Throws:
ForwardRequest

_getChildPOA

public POA _getChildPOA(java.lang.String adapter_name)
                 throws ParentIsHolding
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

Throws:
ParentIsHolding

_getQualifiedName

public java.lang.String _getQualifiedName()
returns the complete poa name


_invoke

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

Throws:
WrongAdapter

_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


activate_object

public byte[] activate_object(Servant servant)
                       throws ServantAlreadyActive,
                              WrongPolicy
Specified by:
activate_object in interface POAOperations
Throws:
ServantAlreadyActive
WrongPolicy

activate_object_with_id

public void activate_object_with_id(byte[] oid,
                                    Servant servant)
                             throws ServantAlreadyActive,
                                    ObjectAlreadyActive,
                                    WrongPolicy
Specified by:
activate_object_with_id in interface POAOperations
Throws:
ServantAlreadyActive
ObjectAlreadyActive
WrongPolicy

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)

create_id_assignment_policy

public IdAssignmentPolicy create_id_assignment_policy(IdAssignmentPolicyValue value)
Specified by:
create_id_assignment_policy in interface POAOperations

create_id_uniqueness_policy

public IdUniquenessPolicy create_id_uniqueness_policy(IdUniquenessPolicyValue value)
Specified by:
create_id_uniqueness_policy in interface POAOperations

create_implicit_activation_policy

public ImplicitActivationPolicy create_implicit_activation_policy(ImplicitActivationPolicyValue value)
Specified by:
create_implicit_activation_policy in interface POAOperations

create_lifespan_policy

public LifespanPolicy create_lifespan_policy(LifespanPolicyValue value)
Specified by:
create_lifespan_policy in interface POAOperations

create_POA

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

Specified by:
create_POA in interface POAOperations
Throws:
AdapterAlreadyExists
InvalidPolicy

create_reference

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

Specified by:
create_reference in interface POAOperations
Throws:
WrongPolicy

create_reference_with_id

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

Specified by:
create_reference_with_id in interface POAOperations
Throws:
WrongPolicy

create_request_processing_policy

public RequestProcessingPolicy create_request_processing_policy(RequestProcessingPolicyValue value)
Specified by:
create_request_processing_policy in interface POAOperations

create_servant_retention_policy

public ServantRetentionPolicy create_servant_retention_policy(ServantRetentionPolicyValue value)
Specified by:
create_servant_retention_policy in interface POAOperations

create_thread_policy

public ThreadPolicy create_thread_policy(ThreadPolicyValue value)
Specified by:
create_thread_policy in interface POAOperations

deactivate_object

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

Specified by:
deactivate_object in interface POAOperations
Throws:
ObjectNotActive
WrongPolicy

destroy

public void destroy(boolean etherealize_objects,
                    boolean wait_for_completion)
Specified by:
destroy in interface POAOperations

find_POA

public POA find_POA(java.lang.String adapter_name,
                    boolean activate_it)
             throws AdapterNonExistent
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.

Specified by:
find_POA in interface POAOperations
Throws:
AdapterNonExistent

get_servant

public Servant get_servant()
                    throws NoServant,
                           WrongPolicy
Specified by:
get_servant in interface POAOperations
Throws:
NoServant
WrongPolicy

get_servant_manager

public ServantManager get_servant_manager()
                                   throws WrongPolicy
Specified by:
get_servant_manager in interface POAOperations
Throws:
WrongPolicy

getMonitor

protected POAMonitor getMonitor()

getORB

protected ORB getORB()

getPOAId

public byte[] getPOAId()

getReference

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

getRequestController

protected RequestController getRequestController()

getState

protected State getState()

id_to_reference

public Object id_to_reference(byte[] oid)
                       throws ObjectNotActive,
                              WrongPolicy
Specified by:
id_to_reference in interface POAOperations
Throws:
ObjectNotActive
WrongPolicy

id_to_servant

public Servant id_to_servant(byte[] oid)
                      throws ObjectNotActive,
                             WrongPolicy
Specified by:
id_to_servant in interface POAOperations
Throws:
ObjectNotActive
WrongPolicy

isActive

protected boolean isActive()

checkDestructionApparent

protected void checkDestructionApparent()

checkNotLocal

protected static void checkNotLocal(Object obj)
                             throws WrongAdapter
Throws:
WrongAdapter

isDestructionApparent

protected boolean isDestructionApparent()

isDestructionComplete

protected boolean isDestructionComplete()

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()

isSystemId

public boolean isSystemId()

isUniqueId

protected boolean isUniqueId()

isUseDefaultServant

protected boolean isUseDefaultServant()

isUseServantManager

public boolean isUseServantManager()

isSSLRequired

public boolean isSSLRequired()

previouslyGeneratedObjectId

public boolean previouslyGeneratedObjectId(byte[] oid)

previouslyGeneratedObjectKey

public boolean previouslyGeneratedObjectKey(byte[] object_key)

reference_to_id

public byte[] reference_to_id(Object reference)
                       throws WrongAdapter,
                              WrongPolicy
Specified by:
reference_to_id in interface POAOperations
Throws:
WrongAdapter
WrongPolicy

reference_to_servant

public Servant reference_to_servant(Object reference)
                             throws ObjectNotActive,
                                    WrongAdapter,
                                    WrongPolicy
Specified by:
reference_to_servant in interface POAOperations
Throws:
ObjectNotActive
WrongAdapter
WrongPolicy

removePOAListener

protected void removePOAListener(POAListener listener)

servant_to_id

public byte[] servant_to_id(Servant servant)
                     throws ServantNotActive,
                            WrongPolicy
Specified by:
servant_to_id in interface POAOperations
Throws:
ServantNotActive
WrongPolicy

servant_to_reference

public Object servant_to_reference(Servant servant)
                            throws ServantNotActive,
                                   WrongPolicy
Specified by:
servant_to_reference in interface POAOperations
Throws:
ServantNotActive
WrongPolicy

set_servant

public void set_servant(Servant _defaultServant)
                 throws WrongPolicy
Specified by:
set_servant in interface POAOperations
Throws:
WrongPolicy

set_servant_manager

public void set_servant_manager(ServantManager servant_manager)
                         throws WrongPolicy
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.)

Specified by:
set_servant_manager in interface POAOperations
Throws:
WrongPolicy

setMonitor

protected void setMonitor(POAMonitor _monitor)

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)

Specified by:
the_activator in interface POAOperations

the_activator

public void the_activator(AdapterActivator adapter_activator)
Specified by:
the_activator in interface POAOperations

the_name

public java.lang.String the_name()
Specified by:
the_name in interface POAOperations

the_parent

public POA the_parent()
Specified by:
the_parent in interface POAOperations

the_children

public POA[] the_children()
Specified by:
the_children in interface POAOperations

the_POAManager

public POAManager the_POAManager()
Specified by:
the_POAManager in interface POAOperations

unregisterChild

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


useDefaultServant

public boolean useDefaultServant()
called from Delegate


useServantManager

protected boolean useServantManager()

getPolicy

public Policy getPolicy(int type)

addLocalRequest

public void addLocalRequest()

removeLocalRequest

public void removeLocalRequest()

getNumberOfObjects

public int getNumberOfObjects()