Public Member Functions | Package Functions

alma.alarmsystem.corbaservice.AlarmSystemContainerServices Class Reference

Inheritance diagram for alma.alarmsystem.corbaservice.AlarmSystemContainerServices:
alma.acs.container.ContainerServicesBase

List of all members.

Public Member Functions

 AlarmSystemContainerServices (AlarmSystemCorbaServer alSysCorbaServer, AcsLogger theLogger)
POA getPOAForOffshoots (POA componentPOA) throws AcsJContainerEx, AcsJUnexpectedExceptionEx
AdvancedContainerServices getAdvancedContainerServices ()
AcsLogger getLogger ()
String getName ()
ThreadFactory getThreadFactory ()
DAL getCDB () throws AcsJContainerServicesEx
ORB getOrb ()
void deactivateOffShoot (Object offshootImpl) throws AcsJContainerServicesEx

Package Functions

public< T extends Servant
&OffShootOperations > OffShoot 
activateOffShoot (T cbServant) throws AcsJContainerServicesEx

Constructor & Destructor Documentation

alma.alarmsystem.corbaservice.AlarmSystemContainerServices.AlarmSystemContainerServices ( AlarmSystemCorbaServer  alSysCorbaServer,
AcsLogger  theLogger 
)

Constructor

Parameters:
theOrb The ORB
theLogger The logger

References alma.acs.alarmsystem.corbaservice.AlarmSystemCorbaServer.getORB().


Member Function Documentation

public<T extends Servant & OffShootOperations> OffShoot alma.alarmsystem.corbaservice.AlarmSystemContainerServices.activateOffShoot ( T  cbServant  )  throws AcsJContainerServicesEx [package]

Activates a CORBA servant that implements alma.ACS.OffShoot. The purpose of the OffShoot marker interface is to crack down on uncontrolled activation of just any CORBA services by Java components, while allowing this for selected subtypes of OffShoot, like alma.ACS.Callback.

The OffShoot servant can be either a subclass of the xyzPOA skeleton, or a xyzPOATie instance (delegation model). Since ACS 4.1.2, a tie servant is detected, and interception code gets inserted between the POATie skeleton and the offshoot implementation class. This way, the container can intercept (and log) calls to offshoots in the same way as it does for calls to components. It is therefore recommended to use the tie approach for all offshoot servants, unless there is a reason to avoid container interception.

Note that since ACS 9.0 we are using generics to express that the offshoot impl object must be both a corba servant and implement OffShootOperations.

Parameters:
cbServant the CORBA-generated servant, e.g. CBdoublePOA; must implement alma.ACS.OffShootOperations.
Returns:
The corba-activated offshoot object, which needs a narrow-cast to the subtype, like CBdouble myCBdouble = alma.ACS.CBdoubleHelper.narrow(...).
Exceptions:
ContainerException if anything goes wrong, especially if cbServant is not an OffShoot.

Implements alma.acs.container.ContainerServicesBase.

References alma.alarmsystem.corbaservice.AlarmSystemContainerServices.getPOAForOffshoots(), and alma.acs.alarmsystem.corbaservice.AlarmSystemCorbaServer.getRootPOA().

void alma.alarmsystem.corbaservice.AlarmSystemContainerServices.deactivateOffShoot ( Object  offshootImpl  )  throws AcsJContainerServicesEx

Deactivates the offshoot object previously activated through the activateOffShoot(Object, Class) method. Caution: this method returns immediately, while the underlying org.omg.PortableServer.POAOperations#deactivate_object(byte[]) still works on the deactivation. If activateOffShoot(Servant) is called too shortly after deactivation, an exception will be thrown. TODO: find a remedy

Parameters:
offshootImpl the offshoot object implementation
Exceptions:
AcsJContainerServicesEx if something goes wrong, e.g., if the corresponding offshoot servant was not active.

Implements alma.acs.container.ContainerServicesBase.

References alma.alarmsystem.corbaservice.AlarmSystemContainerServices.getPOAForOffshoots(), alma.acs.alarmsystem.corbaservice.AlarmSystemCorbaServer.getRootPOA(), and alma.acs.logging.AcsLogger.log().

AdvancedContainerServices alma.alarmsystem.corbaservice.AlarmSystemContainerServices.getAdvancedContainerServices (  ) 

More specialized methods are available from the AdvancedContainerServices.

Implements alma.acs.container.ContainerServicesBase.

DAL alma.alarmsystem.corbaservice.AlarmSystemContainerServices.getCDB (  )  throws AcsJContainerServicesEx

Convenience method for accessing the Configuration Database.

Currently more than a convenience, given that the CDB is not yet a Java component, but a separate service...

Returns:
the CDB interface
Exceptions:
ContainerException 

Implements alma.acs.container.ContainerServicesBase.

References alma.acs.alarmsystem.corbaservice.AlarmSystemCorbaServer.getServiceFromNameServer(), and alma.acs.logging.AcsLogger.log().

AcsLogger alma.alarmsystem.corbaservice.AlarmSystemContainerServices.getLogger (  ) 

Gets a Logger object that the component should use for logging.

The Logger will be set up with a namespace specific to the component that uses this ContainerServices instance.

Specific logger extensions that only apply to certain subsystems can be used by wrapping this logger with a class such as alma.acs.logging.domainspecific.AntennaContextLogger.

Returns:
Logger

Implements alma.acs.container.ContainerServicesBase.

Referenced by alma.alarmsystem.corbaservice.AlarmSystemAdvancedContainerServices.AlarmSystemAdvancedContainerServices().

String alma.alarmsystem.corbaservice.AlarmSystemContainerServices.getName (  ) 

Delivers the unique instance name for the component. The name must have been specified at deployment time in the CDB (for static components like the famous "LAMP1" example), or must have been given to the manager at runtime by the client who creates a dynamic component (or was invented by the manager if none was given).

Returns:
the unique component instance name

Implements alma.acs.container.ContainerServicesBase.

ORB alma.alarmsystem.corbaservice.AlarmSystemContainerServices.getOrb (  ) 
POA alma.alarmsystem.corbaservice.AlarmSystemContainerServices.getPOAForOffshoots ( POA  componentPOA  )  throws AcsJContainerEx, AcsJUnexpectedExceptionEx
ThreadFactory alma.alarmsystem.corbaservice.AlarmSystemContainerServices.getThreadFactory (  ) 

Gets a ThreadFactory, to be used as input for other classes from the concurrent library (such as ThreadPoolExecutor), or simply to create new Threads.

All user-created threads should come from the factory returned here, so "<code>new Thread(...)</code>" should not appear anywhere in component code.

The returned thread factory creates new threads configured to run well in the container environment, e.g.

  • all threads are daeemon threads so that they can't interfere with container shutdown.
  • the priority is the same as that of the calling component thread (which is created by the ORB)
  • uncaught user exceptions are logged as WARNING before the thread terminates.
  • when a component is removed from the container, surviving user threads created by that component are killed using Thread#stop() (which even though deprecated, seems like the perfect choice in this particular situation). Otherwise a faulty components could permanently take away resources from a running container and from the other components.
Returns:
the thread factory to be used by the component to create new threads.

Implements alma.acs.container.ContainerServicesBase.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties