com.arjuna.orbportability
Class OA

java.lang.Object
  extended bycom.arjuna.orbportability.OA
Direct Known Subclasses:
ChildOA, RootOA

public abstract class OA
extends java.lang.Object

An attempt at some ORB portable ways of interacting with the OA. NOTE: initPOA *must* be called if you want to use the pre- and post- initialisation mechanisms.

Since:
JTS 2.1.
Version:
$Id: OA.java 2342 2006-03-30 13:06:17Z $
Author:
Mark Little (mark@arjuna.com)

Field Summary
protected  java.lang.String _defaultAdapterName
           
protected  java.lang.String _oaName
           
protected  java.util.Hashtable _postOAInitProperty
           
protected  java.util.Hashtable _postOAShutdown
           
protected  java.util.Hashtable _preOAInitProperty
           
protected  java.util.Hashtable _preOAShutdown
           
 
Method Summary
 boolean addAttribute(Attribute p)
           
 void addPostShutdown(PostShutdown c)
           
 void addPreShutdown(PreShutdown c)
           
abstract  org.omg.CORBA.Object corbaReference(org.omg.PortableServer.Servant obj)
           
 org.omg.CORBA.Object corbaReference(org.omg.PortableServer.Servant obj, org.omg.PortableServer.POA poa)
           
 ChildOA createPOA(java.lang.String adapterName, org.omg.CORBA.Policy[] policies)
           
abstract  void destroy()
           
 ORB getAssociatedORB()
           
static RootOA getRootOA(ORB associatedORB)
          Retrieve an OA instance given a unique name, if an OA instance with this name doesn't exist then create it.
 void init()
          Ensure that all OA specific initialisation is done even if the programmer uses the OA specific init routines.
 void initOA()
           
 void initOA(java.lang.String[] args)
           
 void initPOA()
           
 void initPOA(java.lang.String[] args)
           
abstract  boolean objectIsReady(org.omg.PortableServer.Servant obj)
           
abstract  boolean objectIsReady(org.omg.PortableServer.Servant obj, byte[] id)
          Register the object with the ORB.
protected  void performPostInit(java.lang.String oaName)
          Loads and runs the configured post-initialisation classes
protected  void performPostSet(java.lang.String oaName)
           
protected  void performPreInit(java.lang.String oaName)
          Loads and runs the configured pre-initialisation classes
 org.omg.PortableServer.POA poa(java.lang.String adapterName)
           
 org.omg.PortableServer.POA rootPoa()
           
 void run()
           
 void run(java.lang.String name)
          Place the server into a state where it can begin to accept requests for objects from clients.
 void setPOA(org.omg.PortableServer.POA p)
           
 boolean setPoa(java.lang.String adapterName, org.omg.PortableServer.POA thePOA)
           
abstract  boolean shutdownObject(org.omg.CORBA.Object obj)
          Dispose of the object, i.e., unregister it from the ORB.
abstract  boolean shutdownObject(org.omg.PortableServer.Servant obj)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_defaultAdapterName

protected java.lang.String _defaultAdapterName

_oaName

protected java.lang.String _oaName

_preOAShutdown

protected java.util.Hashtable _preOAShutdown

_postOAShutdown

protected java.util.Hashtable _postOAShutdown

_preOAInitProperty

protected java.util.Hashtable _preOAInitProperty

_postOAInitProperty

protected java.util.Hashtable _postOAInitProperty
Method Detail

init

public void init()
          throws org.omg.CORBA.SystemException
Ensure that all OA specific initialisation is done even if the programmer uses the OA specific init routines. This method does not need to be called if using initOA methods.

Throws:
org.omg.CORBA.SystemException
Since:
JTS 2.1.1.

initPOA

public void initPOA()
             throws org.omg.CORBA.ORBPackage.InvalidName,
                    org.omg.CORBA.SystemException
Throws:
org.omg.CORBA.ORBPackage.InvalidName
org.omg.CORBA.SystemException

getAssociatedORB

public ORB getAssociatedORB()

setPOA

public void setPOA(org.omg.PortableServer.POA p)
            throws org.omg.CORBA.SystemException
Throws:
org.omg.CORBA.SystemException

performPreInit

protected void performPreInit(java.lang.String oaName)
Loads and runs the configured pre-initialisation classes


performPostSet

protected void performPostSet(java.lang.String oaName)

performPostInit

protected void performPostInit(java.lang.String oaName)
Loads and runs the configured post-initialisation classes


initPOA

public void initPOA(java.lang.String[] args)
             throws org.omg.CORBA.ORBPackage.InvalidName,
                    org.omg.CORBA.SystemException
Throws:
org.omg.CORBA.ORBPackage.InvalidName
org.omg.CORBA.SystemException

createPOA

public ChildOA createPOA(java.lang.String adapterName,
                         org.omg.CORBA.Policy[] policies)
                  throws org.omg.PortableServer.POAPackage.AdapterAlreadyExists,
                         org.omg.PortableServer.POAPackage.InvalidPolicy,
                         org.omg.PortableServer.POAManagerPackage.AdapterInactive
Throws:
org.omg.PortableServer.POAPackage.AdapterAlreadyExists
org.omg.PortableServer.POAPackage.InvalidPolicy
org.omg.PortableServer.POAManagerPackage.AdapterInactive

initOA

public void initOA()
            throws org.omg.CORBA.ORBPackage.InvalidName,
                   org.omg.CORBA.SystemException
Throws:
org.omg.CORBA.ORBPackage.InvalidName
org.omg.CORBA.SystemException

initOA

public void initOA(java.lang.String[] args)
            throws org.omg.CORBA.ORBPackage.InvalidName,
                   org.omg.CORBA.SystemException
Throws:
org.omg.CORBA.ORBPackage.InvalidName
org.omg.CORBA.SystemException

addAttribute

public boolean addAttribute(Attribute p)

destroy

public abstract void destroy()
                      throws org.omg.CORBA.SystemException
Throws:
org.omg.CORBA.SystemException

rootPoa

public org.omg.PortableServer.POA rootPoa()

poa

public org.omg.PortableServer.POA poa(java.lang.String adapterName)

setPoa

public boolean setPoa(java.lang.String adapterName,
                      org.omg.PortableServer.POA thePOA)

addPreShutdown

public void addPreShutdown(PreShutdown c)

addPostShutdown

public void addPostShutdown(PostShutdown c)

corbaReference

public abstract org.omg.CORBA.Object corbaReference(org.omg.PortableServer.Servant obj)
Returns:
a CORBA object reference for the Servant/Implementation.

corbaReference

public org.omg.CORBA.Object corbaReference(org.omg.PortableServer.Servant obj,
                                           org.omg.PortableServer.POA poa)

objectIsReady

public abstract boolean objectIsReady(org.omg.PortableServer.Servant obj,
                                      byte[] id)
                               throws org.omg.CORBA.SystemException
Register the object with the ORB.

Throws:
org.omg.CORBA.SystemException

objectIsReady

public abstract boolean objectIsReady(org.omg.PortableServer.Servant obj)
                               throws org.omg.CORBA.SystemException
Throws:
org.omg.CORBA.SystemException

shutdownObject

public abstract boolean shutdownObject(org.omg.CORBA.Object obj)
Dispose of the object, i.e., unregister it from the ORB.


shutdownObject

public abstract boolean shutdownObject(org.omg.PortableServer.Servant obj)

run

public void run(java.lang.String name)
         throws org.omg.CORBA.SystemException
Place the server into a state where it can begin to accept requests for objects from clients.

Throws:
org.omg.CORBA.SystemException

run

public void run()
         throws org.omg.CORBA.SystemException
Throws:
org.omg.CORBA.SystemException

getRootOA

public static RootOA getRootOA(ORB associatedORB)
Retrieve an OA instance given a unique name, if an OA instance with this name doesn't exist then create it.

Parameters:
associatedORB - The ORB this OA is being created for.
Returns:
The OA instance refered to by the name given.