com.iona.corbautil
Class PoaUtility

java.lang.Object
  |
  +--com.iona.corbautil.PoaUtility
Direct Known Subclasses:
PoaUtilityPortableImpl

public abstract class PoaUtility
extends java.lang.Object

This class simplifies the construction of POA hierarchies.


Field Summary
static int FIXED_PORTS_NO_IMR
          One of four supported deployment models; the server listens on fixed ports and is deployed without an IMR.
static int FIXED_PORTS_WITH_IMR
          One of four supported deployment models; the server listens on fixed ports and is deployed with an IMR.
static int RANDOM_PORTS_NO_IMR
          One of four supported deployment models; the server listens on random ports and is deployed without an IMR.
static int RANDOM_PORTS_WITH_IMR
          One of four supported deployment models; the server listens on random ports and is deployed with an IMR.
 
Constructor Summary
PoaUtility()
           
 
Method Summary
abstract  org.omg.PortableServer.POA createPoa(java.lang.String poaName, org.omg.PortableServer.POA parentPoa, com.iona.corbautil.LabelledPOAManager labelledMgr, java.lang.String policiesStr)
          Create a POA.
abstract  com.iona.corbautil.LabelledPOAManager createPoaManager(java.lang.String label)
          Create a POA Manager.
static com.iona.corbautil.PoaUtility init(org.omg.CORBA.ORB orb, int deployModel)
          Create an instance of a PoaUtlity class.
abstract  org.omg.PortableServer.POA root()
          Accessor for the root POA.
static int stringToDeploymentModel(java.lang.String model)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RANDOM_PORTS_NO_IMR

public static final int RANDOM_PORTS_NO_IMR
One of four supported deployment models; the server listens on random ports and is deployed without an IMR.

See Also:
Constant Field Values

RANDOM_PORTS_WITH_IMR

public static final int RANDOM_PORTS_WITH_IMR
One of four supported deployment models; the server listens on random ports and is deployed with an IMR.

See Also:
Constant Field Values

FIXED_PORTS_NO_IMR

public static final int FIXED_PORTS_NO_IMR
One of four supported deployment models; the server listens on fixed ports and is deployed without an IMR.

See Also:
Constant Field Values

FIXED_PORTS_WITH_IMR

public static final int FIXED_PORTS_WITH_IMR
One of four supported deployment models; the server listens on fixed ports and is deployed with an IMR.

See Also:
Constant Field Values
Constructor Detail

PoaUtility

public PoaUtility()
Method Detail

stringToDeploymentModel

public static int stringToDeploymentModel(java.lang.String model)
                                   throws PoaUtilityException
PoaUtilityException

init

public static com.iona.corbautil.PoaUtility init(org.omg.CORBA.ORB orb,
                                                 int deployModel)
Create an instance of a PoaUtlity class. This class uses system properties combined with Java's reflection APIs to load and create an appropriate sub-class of PoaUtility. The algorithm used is as follows.

If the sytem property com.iona.corbautil.PoaUtilityClass exists then the class it specifies is used.
Otherwise, the org.omg.CORBA.ORBClass system property is examined. If this property specifies the class associated with either Orbix or ORBacus then an Orbix-specific or ORBacus-specific subclass of PoaUtility is created.
Otherwise, the com.iona.corbautil.PoaUtilityPortableImpl class is loaded.

The com.iona.corbautil.PoaUtilityPortableImpl class is implemented with only CORBA-compliant APIs so it can be used with any CORBA-vendor product. However, it may not be able to use all of the four server deployment models.

Parameters:
orb - The ORB.
deployModel - One of the four supported deployment models. You should set this to one of: PoaUtility.RANDOM_PORTS_NO_IMR, PoaUtility.RANDOM_PORTS_WITH_IMR, PoaUtility.FIXED_PORTS_NO_IMR or PoaUtility.FIXED_PORTS_WITH_IMR.
Returns:
The newly created POAUtility object

createPoa

public abstract org.omg.PortableServer.POA createPoa(java.lang.String poaName,
                                                     org.omg.PortableServer.POA parentPoa,
                                                     com.iona.corbautil.LabelledPOAManager labelledMgr,
                                                     java.lang.String policiesStr)
                                              throws PoaUtilityException
Create a POA.

Parameters:
poaName - Name of the POA being created
parentPoa - The parent POA
labelledMgr - The (labelled) POA Manager (previously created by calling createPoaManager()
policiesStr - A string that lists the policies to be used for the POA, for example, "persistent + user_id + retain". Individual policies are spelt just as in the CORBA specification, except that they are in lowercase. Any combination of spaces, commas and/or plus-signs can be used as separators between policy names.
Returns:
The newly created POA.
PoaUtilityException

createPoaManager

public abstract com.iona.corbautil.LabelledPOAManager createPoaManager(java.lang.String label)
                                                                throws PoaUtilityException
Create a POA Manager.

Parameters:
label - A label (name) that is to be associated with the newly created POA Manager. If the deployModel parameter to init() specifies a deployment model that involves fixed ports then CORBA-vendor-specific entries in a runtime configuration file and/or command-line options are used to specify on which fixed port the POA Manager listens.
Returns:
The newly created POA manager.
PoaUtilityException

root

public abstract org.omg.PortableServer.POA root()
Accessor for the root POA.

Returns:
The root POA.