org.jacorb.poa
Class POA

java.lang.Object
  extended by _POALocalBase
      extended by org.jacorb.poa.POA
All Implemented Interfaces:
org.apache.avalon.framework.configuration.Configurable

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.65 2006/07/13 08:46:37 nick.cross Exp $
Author:
Reimo Tiedemann, FU Berlin

Field Summary
protected  BidirectionalPolicy bidirectionalPolicy
           
protected  org.omg.PortableServer.IdAssignmentPolicy idAssignmentPolicy
           
protected  org.omg.PortableServer.IdUniquenessPolicy idUniquenessPolicy
           
protected  org.omg.PortableServer.ImplicitActivationPolicy implicitActivationPolicy
           
protected  org.omg.PortableServer.LifespanPolicy lifespanPolicy
           
protected  org.omg.PortableServer.RequestProcessingPolicy requestProcessingPolicy
           
protected  org.omg.PortableServer.ServantRetentionPolicy servantRetentionPolicy
           
protected  SSLPolicy sslPolicy
           
protected  org.omg.PortableServer.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
 org.omg.PortableServer.Servant _incarnateServant(byte[] oid, org.omg.PortableServer.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, org.omg.PortableServer.Servant servant)
           
 byte[] activate_object(org.omg.PortableServer.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(org.omg.CORBA.Object obj)
           
 void configure(org.apache.avalon.framework.configuration.Configuration myConfiguration)
           
 org.omg.PortableServer.IdAssignmentPolicy create_id_assignment_policy(org.omg.PortableServer.IdAssignmentPolicyValue value)
           
 org.omg.PortableServer.IdUniquenessPolicy create_id_uniqueness_policy(org.omg.PortableServer.IdUniquenessPolicyValue value)
           
 org.omg.PortableServer.ImplicitActivationPolicy create_implicit_activation_policy(org.omg.PortableServer.ImplicitActivationPolicyValue value)
           
 org.omg.PortableServer.LifespanPolicy create_lifespan_policy(org.omg.PortableServer.LifespanPolicyValue value)
           
 org.omg.PortableServer.POA create_POA(java.lang.String adapter_name, org.omg.PortableServer.POAManager a_POAManager, org.omg.CORBA.Policy[] policies)
          additionally raises an org.omg.CORBA.BAD_INV_ORDER exception if the poa goes shutdown and this method will called (not spec.)
 org.omg.CORBA.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
 org.omg.CORBA.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
 org.omg.PortableServer.RequestProcessingPolicy create_request_processing_policy(org.omg.PortableServer.RequestProcessingPolicyValue value)
           
 org.omg.PortableServer.ServantRetentionPolicy create_servant_retention_policy(org.omg.PortableServer.ServantRetentionPolicyValue value)
           
 org.omg.PortableServer.ThreadPolicy create_thread_policy(org.omg.PortableServer.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)
           
 org.omg.PortableServer.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.
 org.omg.PortableServer.ServantManager get_servant_manager()
           
 org.omg.PortableServer.Servant get_servant()
           
protected  POAMonitor getMonitor()
           
 int getNumberOfObjects()
           
protected  ORB getORB()
           
 byte[] getPOAId()
           
 org.omg.CORBA.Policy getPolicy(int type)
           
protected  org.omg.CORBA.Object getReference(byte[] oid, java.lang.String intf_rep_id, boolean cache)
           
protected  RequestController getRequestController()
           
protected  org.omg.PortableServer.POAManagerPackage.State getState()
           
 org.omg.CORBA.Object id_to_reference(byte[] oid)
           
 org.omg.PortableServer.Servant id_to_servant(byte[] oid)
           
protected  boolean isActive()
           
protected  boolean isDestructionApparent()
           
 boolean isDestructionComplete()
          isDestructionComplete returns whether the POA has been completely destroyed (including finishing outstanding requests).
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(org.omg.CORBA.Object reference)
           
 org.omg.PortableServer.Servant reference_to_servant(org.omg.CORBA.Object reference)
           
 void removeLocalRequest()
           
protected  void removePOAListener(POAListener listener)
           
 byte[] servant_to_id(org.omg.PortableServer.Servant servant)
           
 org.omg.CORBA.Object servant_to_reference(org.omg.PortableServer.Servant servant)
           
 void set_servant_manager(org.omg.PortableServer.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(org.omg.PortableServer.Servant _defaultServant)
           
protected  void setMonitor(POAMonitor _monitor)
           
 org.omg.PortableServer.AdapterActivator the_activator()
          it is system-dependent whether the root POA initially has an adapter activator.
 void the_activator(org.omg.PortableServer.AdapterActivator adapter_activator)
           
 org.omg.PortableServer.POA[] the_children()
           
 java.lang.String the_name()
           
 org.omg.PortableServer.POA the_parent()
           
 org.omg.PortableServer.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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

threadPolicy

protected org.omg.PortableServer.ThreadPolicy threadPolicy

lifespanPolicy

protected org.omg.PortableServer.LifespanPolicy lifespanPolicy

idUniquenessPolicy

protected org.omg.PortableServer.IdUniquenessPolicy idUniquenessPolicy

idAssignmentPolicy

protected org.omg.PortableServer.IdAssignmentPolicy idAssignmentPolicy

servantRetentionPolicy

protected org.omg.PortableServer.ServantRetentionPolicy servantRetentionPolicy

requestProcessingPolicy

protected org.omg.PortableServer.RequestProcessingPolicy requestProcessingPolicy

implicitActivationPolicy

protected org.omg.PortableServer.ImplicitActivationPolicy implicitActivationPolicy

bidirectionalPolicy

protected BidirectionalPolicy bidirectionalPolicy

sslPolicy

protected 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 org.omg.PortableServer.Servant _incarnateServant(byte[] oid,
                                                        org.omg.PortableServer.ServantActivator sa)
                                                 throws org.omg.PortableServer.ForwardRequest
Called from Delegate. To ensure thread safety we use the AOM::incarnate method when activating a servant with the ServantActivator.

Throws:
org.omg.PortableServer.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 org.omg.PortableServer.POAPackage.WrongAdapter
called from orb for handing over a request

Throws:
org.omg.PortableServer.POAPackage.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(org.omg.PortableServer.Servant servant)
                       throws org.omg.PortableServer.POAPackage.ServantAlreadyActive,
                              org.omg.PortableServer.POAPackage.WrongPolicy
Throws:
org.omg.PortableServer.POAPackage.ServantAlreadyActive
org.omg.PortableServer.POAPackage.WrongPolicy

activate_object_with_id

public void activate_object_with_id(byte[] oid,
                                    org.omg.PortableServer.Servant servant)
                             throws org.omg.PortableServer.POAPackage.ServantAlreadyActive,
                                    org.omg.PortableServer.POAPackage.ObjectAlreadyActive,
                                    org.omg.PortableServer.POAPackage.WrongPolicy
Throws:
org.omg.PortableServer.POAPackage.ServantAlreadyActive
org.omg.PortableServer.POAPackage.ObjectAlreadyActive
org.omg.PortableServer.POAPackage.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 org.omg.PortableServer.IdAssignmentPolicy create_id_assignment_policy(org.omg.PortableServer.IdAssignmentPolicyValue value)

create_id_uniqueness_policy

public org.omg.PortableServer.IdUniquenessPolicy create_id_uniqueness_policy(org.omg.PortableServer.IdUniquenessPolicyValue value)

create_implicit_activation_policy

public org.omg.PortableServer.ImplicitActivationPolicy create_implicit_activation_policy(org.omg.PortableServer.ImplicitActivationPolicyValue value)

create_lifespan_policy

public org.omg.PortableServer.LifespanPolicy create_lifespan_policy(org.omg.PortableServer.LifespanPolicyValue value)

create_POA

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

Throws:
org.omg.PortableServer.POAPackage.AdapterAlreadyExists
org.omg.PortableServer.POAPackage.InvalidPolicy

create_reference

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

Throws:
org.omg.PortableServer.POAPackage.WrongPolicy

create_reference_with_id

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

Throws:
org.omg.PortableServer.POAPackage.WrongPolicy

create_request_processing_policy

public org.omg.PortableServer.RequestProcessingPolicy create_request_processing_policy(org.omg.PortableServer.RequestProcessingPolicyValue value)

create_servant_retention_policy

public org.omg.PortableServer.ServantRetentionPolicy create_servant_retention_policy(org.omg.PortableServer.ServantRetentionPolicyValue value)

create_thread_policy

public org.omg.PortableServer.ThreadPolicy create_thread_policy(org.omg.PortableServer.ThreadPolicyValue value)

deactivate_object

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

Throws:
org.omg.PortableServer.POAPackage.ObjectNotActive
org.omg.PortableServer.POAPackage.WrongPolicy

destroy

public void destroy(boolean etherealize_objects,
                    boolean wait_for_completion)

find_POA

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

Throws:
org.omg.PortableServer.POAPackage.AdapterNonExistent

get_servant

public org.omg.PortableServer.Servant get_servant()
                                           throws org.omg.PortableServer.POAPackage.NoServant,
                                                  org.omg.PortableServer.POAPackage.WrongPolicy
Throws:
org.omg.PortableServer.POAPackage.NoServant
org.omg.PortableServer.POAPackage.WrongPolicy

get_servant_manager

public org.omg.PortableServer.ServantManager get_servant_manager()
                                                          throws org.omg.PortableServer.POAPackage.WrongPolicy
Throws:
org.omg.PortableServer.POAPackage.WrongPolicy

getMonitor

protected POAMonitor getMonitor()

getORB

protected ORB getORB()

getPOAId

public byte[] getPOAId()

getReference

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

getRequestController

protected RequestController getRequestController()

getState

protected org.omg.PortableServer.POAManagerPackage.State getState()

id_to_reference

public org.omg.CORBA.Object id_to_reference(byte[] oid)
                                     throws org.omg.PortableServer.POAPackage.ObjectNotActive,
                                            org.omg.PortableServer.POAPackage.WrongPolicy
Throws:
org.omg.PortableServer.POAPackage.ObjectNotActive
org.omg.PortableServer.POAPackage.WrongPolicy

id_to_servant

public org.omg.PortableServer.Servant id_to_servant(byte[] oid)
                                             throws org.omg.PortableServer.POAPackage.ObjectNotActive,
                                                    org.omg.PortableServer.POAPackage.WrongPolicy
Throws:
org.omg.PortableServer.POAPackage.ObjectNotActive
org.omg.PortableServer.POAPackage.WrongPolicy

isActive

protected boolean isActive()

checkDestructionApparent

protected void checkDestructionApparent()

checkNotLocal

protected static void checkNotLocal(org.omg.CORBA.Object obj)
                             throws org.omg.PortableServer.POAPackage.WrongAdapter
Throws:
org.omg.PortableServer.POAPackage.WrongAdapter

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

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(org.omg.CORBA.Object reference)
                       throws org.omg.PortableServer.POAPackage.WrongAdapter,
                              org.omg.PortableServer.POAPackage.WrongPolicy
Throws:
org.omg.PortableServer.POAPackage.WrongAdapter
org.omg.PortableServer.POAPackage.WrongPolicy

reference_to_servant

public org.omg.PortableServer.Servant reference_to_servant(org.omg.CORBA.Object reference)
                                                    throws org.omg.PortableServer.POAPackage.ObjectNotActive,
                                                           org.omg.PortableServer.POAPackage.WrongAdapter,
                                                           org.omg.PortableServer.POAPackage.WrongPolicy
Throws:
org.omg.PortableServer.POAPackage.ObjectNotActive
org.omg.PortableServer.POAPackage.WrongAdapter
org.omg.PortableServer.POAPackage.WrongPolicy

removePOAListener

protected void removePOAListener(POAListener listener)

servant_to_id

public byte[] servant_to_id(org.omg.PortableServer.Servant servant)
                     throws org.omg.PortableServer.POAPackage.ServantNotActive,
                            org.omg.PortableServer.POAPackage.WrongPolicy
Throws:
org.omg.PortableServer.POAPackage.ServantNotActive
org.omg.PortableServer.POAPackage.WrongPolicy

servant_to_reference

public org.omg.CORBA.Object servant_to_reference(org.omg.PortableServer.Servant servant)
                                          throws org.omg.PortableServer.POAPackage.ServantNotActive,
                                                 org.omg.PortableServer.POAPackage.WrongPolicy
Throws:
org.omg.PortableServer.POAPackage.ServantNotActive
org.omg.PortableServer.POAPackage.WrongPolicy

set_servant

public void set_servant(org.omg.PortableServer.Servant _defaultServant)
                 throws org.omg.PortableServer.POAPackage.WrongPolicy
Throws:
org.omg.PortableServer.POAPackage.WrongPolicy

set_servant_manager

public void set_servant_manager(org.omg.PortableServer.ServantManager servant_manager)
                         throws org.omg.PortableServer.POAPackage.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.)

Throws:
org.omg.PortableServer.POAPackage.WrongPolicy

setMonitor

protected void setMonitor(POAMonitor _monitor)

the_activator

public org.omg.PortableServer.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(org.omg.PortableServer.AdapterActivator adapter_activator)

the_name

public java.lang.String the_name()

the_parent

public org.omg.PortableServer.POA the_parent()

the_children

public org.omg.PortableServer.POA[] the_children()

the_POAManager

public org.omg.PortableServer.POAManager the_POAManager()

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 org.omg.CORBA.Policy getPolicy(int type)

addLocalRequest

public void addLocalRequest()

removeLocalRequest

public void removeLocalRequest()

getNumberOfObjects

public int getNumberOfObjects()