edu.stanford.slac.aida.lib.util.common
Class _DaObjectBase

java.lang.Object
  extended by edu.stanford.slac.aida.lib.util.common._DaObjectBase
Direct Known Subclasses:
_DaObject, _PersistentDaObjectBase

public class _DaObjectBase
extends java.lang.Object

Handles CORBA initialization and initial references to the AIDA Name Server for the AIDA data access API DaObject class hierarchy. It contains only low level ORB connection and initialisation for non-persistent AIDA objects.

Version:
16-Sep-2004, Greg White (greg): Remove catch from constructor, propagate exceptions, 15-Sep-2004, Greg White (greg): Add error handling., 13-Nov-2002, Ron MacKenzie (ronm): Change import of except from aida to except package.
Author:
George McIntyre

Field Summary
static java.lang.String[][] DAO_PROPS
          CORBA Properties that are passed to ORB.init() to initialise the ORB.
protected  org.omg.PortableServer.POA m_consumerPOA
           
protected static edu.stanford.slac.err.Err m_err
           
protected  org.omg.CosEventChannelAdmin.EventChannel m_event_channel
           
 org.omg.CORBA.ORB m_orb
          Internal CORBA ORB associated with this Data Access Object
protected  org.omg.PortableServer.POAManager m_POA_manager
           
protected  java.util.Properties m_props
           
protected  org.omg.PortableServer.POA m_rootPOA
           
 
Constructor Summary
_DaObjectBase()
          No arg Constructor (for when there are no CORBA parameters to override).
_DaObjectBase(java.lang.String[] args)
          Constructor with corba argument list.
_DaObjectBase(java.lang.String[] args, boolean events)
          Constructs a _DaObjectBase including EventService initialization if desired
_DaObjectBase(java.lang.String[] args, java.lang.String childPersistentPOAName)
          Constructor with CORBA argument list and given Portable Object Adapter (POA).
_DaObjectBase(java.lang.String[] args, java.lang.String childPersistentPOAName, boolean events)
          Constructs a _DaObjectBase without EventService
 
Method Summary
 void EventConnect(org.omg.CosEventComm.PushConsumer consumer)
          Connects given consumer to the Event Service.
 java.lang.String getNameServerIOR()
          Get the AIDA Name Server's Interoperable Object Reference.
 org.omg.CORBA.ORB getORB()
           
 org.omg.CosEventChannelAdmin.ProxyPushConsumer getPPConsumer()
          Return the ProxyPushConsumer to anyone who wants to know
protected  void init()
          Initialise the _DaObjectBase.
protected  void init(java.lang.String childPersistentPOAName)
          Initialise the _DaObjectBase given Portable Object Adapter.
protected  void initEventService()
          Initializes a CORBA object as consumer of EventService events
 void setNameServerIOR(java.lang.String ior)
          Get the AIDA Name Server's Interoperable Object Reference.
 void Start()
          Starts the CORBA server
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_orb

public org.omg.CORBA.ORB m_orb
Internal CORBA ORB associated with this Data Access Object


m_POA_manager

protected org.omg.PortableServer.POAManager m_POA_manager

m_rootPOA

protected org.omg.PortableServer.POA m_rootPOA

m_consumerPOA

protected org.omg.PortableServer.POA m_consumerPOA

m_event_channel

protected org.omg.CosEventChannelAdmin.EventChannel m_event_channel

m_props

protected java.util.Properties m_props

m_err

protected static edu.stanford.slac.err.Err m_err

DAO_PROPS

public static final java.lang.String[][] DAO_PROPS
CORBA Properties that are passed to ORB.init() to initialise the ORB.

Constructor Detail

_DaObjectBase

public _DaObjectBase()
              throws edu.stanford.slac.except.AidaInitException
No arg Constructor (for when there are no CORBA parameters to override).

Throws:
edu.stanford.slac.except.AidaInitException - Init error, probably in CORBA initialization.

_DaObjectBase

public _DaObjectBase(java.lang.String[] args)
              throws edu.stanford.slac.except.AidaInitException
Constructor with corba argument list.

Parameters:
args - a list of CORBA properties name value pairs, in particular the -ORBconfig configfilename. Properties that are not CORBA are ignored so that this parameter may be the argv argument passed into the main program allowing CORBA parameters to be set from the command line.
Throws:
edu.stanford.slac.except.AidaInitException - Init error, probably in CORBA initialization.

_DaObjectBase

public _DaObjectBase(java.lang.String[] args,
                     java.lang.String childPersistentPOAName)
              throws edu.stanford.slac.except.AidaInitException
Constructor with CORBA argument list and given Portable Object Adapter (POA).

Parameters:
args - a list of CORBA properties name value pairs, in particular the -ORBconfig configfilename. Properties that are not CORBA are ignored so that this parameter may be the argv argument passed into the main program allowing CORBA parameters to be set from the command line.
childPersistentPOAName - Server name for persistent CORBA servers
Throws:
edu.stanford.slac.except.AidaInitException - Init error, probably in CORBA initialization.

_DaObjectBase

public _DaObjectBase(java.lang.String[] args,
                     boolean events)
              throws edu.stanford.slac.except.AidaInitException
Constructs a _DaObjectBase including EventService initialization if desired

Parameters:
args - a list of CORBA properties name value pairs, in particular the -ORBconfig configfilename. Properties that are not CORBA are ignored so that this parameter may be the argv argument passed into the main program allowing CORBA parameters to be set from the command line.
events - whether to initialize EventService. If this is true a push_consumerImpl must be in the classpath
Throws:
edu.stanford.slac.except.AidaInitException - Init error, probably in CORBA initialization.

_DaObjectBase

public _DaObjectBase(java.lang.String[] args,
                     java.lang.String childPersistentPOAName,
                     boolean events)
              throws edu.stanford.slac.except.AidaInitException
Constructs a _DaObjectBase without EventService

Parameters:
args - a list of CORBA properties name value pairs, in particular the -ORBconfig configfilename. Properties that are not CORBA are ignored so that this parameter may be the argv argument passed into the main program allowing CORBA parameters to be set from the command line.
childPersistentPOAName - Server name for persistent CORBA servers
events - whether to initialize EventService. If this is true a push_consumerImpl must be in the classpath
Throws:
edu.stanford.slac.except.AidaInitException - Init error, probably in CORBA initialization.
Method Detail

init

protected void init(java.lang.String childPersistentPOAName)
             throws edu.stanford.slac.except.AidaInitException
Initialise the _DaObjectBase given Portable Object Adapter. Set CORBA Properties, initialise the ORB Find the rootPOA and get its Manager.

Throws:
edu.stanford.slac.except.AidaInitException - up-translated exception from CORBA initialization.

getORB

public org.omg.CORBA.ORB getORB()

init

protected void init()
             throws edu.stanford.slac.except.AidaInitException
Initialise the _DaObjectBase. Set CORBA Properties, initialise the ORB Find the rootPOA and get its Manager.

Throws:
edu.stanford.slac.except.AidaInitException - up-translated exception from CORBA initialization.

getPPConsumer

public org.omg.CosEventChannelAdmin.ProxyPushConsumer getPPConsumer()
Return the ProxyPushConsumer to anyone who wants to know

Returns:
Proxy Push Consumer

initEventService

protected void initEventService()
Initializes a CORBA object as consumer of EventService events


EventConnect

public void EventConnect(org.omg.CosEventComm.PushConsumer consumer)
Connects given consumer to the Event Service. [23-Sep-2004, Greg White: Not sure this is ever used].

Parameters:
consumer - a PushConsumer that will receive events

Start

public void Start()
Starts the CORBA server

Throws:
java.lang.IllegalStateException - Error activating the server, or in Orb.run().

getNameServerIOR

public java.lang.String getNameServerIOR()
Get the AIDA Name Server's Interoperable Object Reference. In this implementation it is stored in a file in a well know location and is accessed here by way of a URL.

Returns:
the AIDA Name Server's Interoperable Object Reference

setNameServerIOR

public void setNameServerIOR(java.lang.String ior)
Get the AIDA Name Server's Interoperable Object Reference. In this implementation it is stored in a file in a well know location and is accessed here by way of a URL.

Parameters:
ior - The Interoperable Object Reference for the current server