alma::acs::alarmsystem::corbaservice::AlarmSystemCorbaServer Class Reference

Collaboration diagram for alma::acs::alarmsystem::corbaservice::AlarmSystemCorbaServer:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 AlarmSystemCorbaServer (AcsLogger logger, String[] args) throws Exception
void destroy ()
ORB getORB ()
POA getRootPOA ()
void run ()
Object getServiceFromNameServer (final String serviceName) throws Exception
Logger getLogger ()
OffShoot activateOffShoot (Servant servant) throws AcsJContainerEx, AcsJUnexpectedExceptionEx
void deactivateOffShoot (Servant cbServant) throws AcsJContainerServicesEx, AcsJContainerEx
POA getPOAForOffshoots (POA componentPOA) throws AcsJContainerEx, AcsJUnexpectedExceptionEx
synchronized void shutdown ()

Static Public Member Functions

static void main (String[] args)

Private Member Functions

Servant instantiateCernAS () throws Exception
void internalInitialize (String[] args) throws Exception
NamingContext getNamingContext () throws InvalidName
void registerToNamingService (org.omg.CORBA.Object laserObject) throws Exception
void unregisterToNamingService () throws Exception
void checkOffShootServant (Servant servant) throws AcsJContainerServicesEx
DAL getCDB () throws Exception
boolean getAlarmSystemType () throws Exception

Private Attributes

ORB orb = null
volatile boolean destroyState = false
POA rootPOA = null
POA asPOA = null
POAManager poaManager
final AcsLogger m_logger
Policy[] m_offshootPolicies
boolean isInitialized = false
volatile boolean closed = false
Servant laserComponent = null
Servant acsComponent = null

Detailed Description

Class that provides default ACS CORBA service implementation.

The constructor activate the CORBA servant: the ACS or the CERN implementation, depending on the value read from the CDB.

Author:
acaproni

Constructor & Destructor Documentation

alma::acs::alarmsystem::corbaservice::AlarmSystemCorbaServer::AlarmSystemCorbaServer ( AcsLogger  logger,
String[]  args 
) throws Exception [inline]

Constructor for DefaultCORBAService.

Parameters:
logger The logger
args The arguments from the command line

References acsComponent, asPOA, getAlarmSystemType(), instantiateCernAS(), internalInitialize(), laserComponent, m_logger, registerToNamingService(), run(), and shutdown().

Referenced by main().


Member Function Documentation

OffShoot alma::acs::alarmsystem::corbaservice::AlarmSystemCorbaServer::activateOffShoot ( Servant  servant  )  throws AcsJContainerEx, AcsJUnexpectedExceptionEx [inline]
void alma::acs::alarmsystem::corbaservice::AlarmSystemCorbaServer::checkOffShootServant ( Servant  servant  )  throws AcsJContainerServicesEx [inline, private]
void alma::acs::alarmsystem::corbaservice::AlarmSystemCorbaServer::deactivateOffShoot ( Servant  cbServant  )  throws AcsJContainerServicesEx, AcsJContainerEx [inline]
void alma::acs::alarmsystem::corbaservice::AlarmSystemCorbaServer::destroy (  )  [inline]

Overloads the destroy to first perform a ORB shutdown.

References destroyState, and orb.

Referenced by internalInitialize().

boolean alma::acs::alarmsystem::corbaservice::AlarmSystemCorbaServer::getAlarmSystemType (  )  throws Exception [inline, private]

Query the CDB to understand which one between ACS and CERN implementation has to be used

Returns:
true if ACS implementation must be used
Exceptions:
Exception In case of error

References com::cosylab::CDB::DALOperations::get_DAO(), getCDB(), alma::acs::logging::AcsLogger::log(), and m_logger.

Referenced by AlarmSystemCorbaServer().

DAL alma::acs::alarmsystem::corbaservice::AlarmSystemCorbaServer::getCDB (  )  throws Exception [inline, private]

Get a reference to the DAL.

Returns:
The DAL
Exceptions:
Exception In case of error getting the DAL

References getNamingContext().

Referenced by getAlarmSystemType().

Logger alma::acs::alarmsystem::corbaservice::AlarmSystemCorbaServer::getLogger (  )  [inline]
NamingContext alma::acs::alarmsystem::corbaservice::AlarmSystemCorbaServer::getNamingContext (  )  throws InvalidName [inline, private]
ORB alma::acs::alarmsystem::corbaservice::AlarmSystemCorbaServer::getORB (  )  [inline]

Returns Object Request Broker (ORB) object.

Returns:
Object Request Broker (ORB) object

References orb.

Referenced by alma::alarmsystem::corbaservice::AlarmSystemContainerServices::AlarmSystemContainerServices(), and com::cosylab::acs::laser::LaserComponent::fromBusinessAlarm().

POA alma::acs::alarmsystem::corbaservice::AlarmSystemCorbaServer::getPOAForOffshoots ( POA  componentPOA  )  throws AcsJContainerEx, AcsJUnexpectedExceptionEx [inline]
POA alma::acs::alarmsystem::corbaservice::AlarmSystemCorbaServer::getRootPOA (  )  [inline]

Returns root Portable Object Adapter (POA) object.

Returns:
root Portable Object Adapter (POA) object

References rootPOA.

Object alma::acs::alarmsystem::corbaservice::AlarmSystemCorbaServer::getServiceFromNameServer ( final String  serviceName  )  throws Exception [inline]

Get an object by browsing the name service

Parameters:
serviceName The name of the service to get from the server
Returns:
Exceptions:
org.omg.CosNaming.NamingContextPackage.InvalidName 
CannotProceed 
NotFound 

References getNamingContext().

Referenced by alma::alarmsystem::corbaservice::AlarmSystemContainerServices::getCDB().

Servant alma::acs::alarmsystem::corbaservice::AlarmSystemCorbaServer::instantiateCernAS (  )  throws Exception [inline, private]

Instantiate the CERN alarm service.

At this point the CERN class are still unknown because they are built very late in ACS. Therefore the CERN alarm system is instantiated dynamically.

Returns:
The CERN alarm service

References alma::acs::logging::AcsLogger::log(), and m_logger.

Referenced by AlarmSystemCorbaServer().

void alma::acs::alarmsystem::corbaservice::AlarmSystemCorbaServer::internalInitialize ( String[]  args  )  throws Exception [inline, private]

Initializes the CORBA.

Parameters:
args The command line arguments

References asPOA, destroy(), alma::acs::logging::AcsLogger::log(), m_logger, orb, poaManager, and rootPOA.

Referenced by AlarmSystemCorbaServer().

static void alma::acs::alarmsystem::corbaservice::AlarmSystemCorbaServer::main ( String[]  args  )  [inline, static]
void alma::acs::alarmsystem::corbaservice::AlarmSystemCorbaServer::registerToNamingService ( org.omg.CORBA.Object  laserObject  )  throws Exception [inline, private]

Register the AlarmService name to the Naming Service.

The name to register is taken from the IDL interface.

Parameters:
laserObject The CORBA object to bind to the name

References getNamingContext(), alma::acs::logging::AcsLogger::log(), and m_logger.

Referenced by AlarmSystemCorbaServer().

void alma::acs::alarmsystem::corbaservice::AlarmSystemCorbaServer::run (  )  [inline]

Main thread to handle CORBA requests.

See also:
java.lang.Runnable::run()

References destroyState, alma::acs::logging::AcsLogger::log(), m_logger, and orb.

Referenced by AlarmSystemCorbaServer().

synchronized void alma::acs::alarmsystem::corbaservice::AlarmSystemCorbaServer::shutdown (  )  [inline]

Shuts down the CORBA services.

Note that this method is called by the alarm service as part of its shutdown sequence. But it is also executed when the JVM shuts down (shutdown hook)

References acsComponent, closed, laserComponent, alma::acs::logging::AcsLogger::log(), m_logger, orb, poaManager, rootPOA, and unregisterToNamingService().

Referenced by AlarmSystemCorbaServer(), com::cosylab::acs::laser::LaserComponent::LaserComponentTerminator::run(), and alma::acs::alarmsystem::acsimpl::AcsAlarmSystem::AcsComponentTerminator::run().

void alma::acs::alarmsystem::corbaservice::AlarmSystemCorbaServer::unregisterToNamingService (  )  throws Exception [inline, private]

Unregister the AlarmService name to the Naming Service.

The name to unregister is taken from the IDL interface.

References getNamingContext(), alma::acs::logging::AcsLogger::log(), and m_logger.

Referenced by shutdown().


Member Data Documentation

The ACS CORBA servant

One and only one between laserComponent and acsComponent is not null.

Referenced by AlarmSystemCorbaServer(), and shutdown().

Alarm System POA.

Referenced by AlarmSystemCorbaServer(), and internalInitialize().

Signal if the server has been closed

Referenced by shutdown().

Additional sync check (what if component is destroyed before thread is started).

Referenced by destroy(), and run().

The CERN CORBA servant

One and only one between laserComponent and acsComponent is not null.

Referenced by AlarmSystemCorbaServer(), and shutdown().

Referenced by getPOAForOffshoots().

Object Request Broker (ORB) object.

Referenced by destroy(), getNamingContext(), getORB(), internalInitialize(), run(), and shutdown().

POA manager

Referenced by getPOAForOffshoots(), internalInitialize(), and shutdown().

Root Portable Object Adapter (POA) object.

Referenced by activateOffShoot(), deactivateOffShoot(), getRootPOA(), internalInitialize(), and shutdown().


The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2