public class AlarmSystemContainerServices extends java.lang.Object implements ContainerServicesBase
| Constructor and Description |
|---|
AlarmSystemContainerServices(AlarmSystemCorbaServer alSysCorbaServer,
AcsLogger theLogger)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
<T extends org.omg.PortableServer.Servant & OffShootOperations> |
activateOffShoot(T cbServant)
Activates a CORBA servant that implements alma.ACS.OffShoot.
|
<T> AcsEventPublisher<T> |
createNotificationChannelPublisher(java.lang.String channelName,
java.lang.Class<T> eventType)
Creates a new
AcsEventPublisher object for a given channel. |
<T> AcsEventPublisher<T> |
createNotificationChannelPublisher(java.lang.String channelName,
java.lang.String channelNotifyServiceDomainName,
java.lang.Class<T> eventType)
Similar to
ContainerServicesBase.createNotificationChannelPublisher(String, Class),
but with additional NC domain specification. |
<T> AcsEventSubscriber<T> |
createNotificationChannelSubscriber(java.lang.String channelName,
java.lang.Class<T> eventType)
Creates a new
AcsEventSubscriber object, which is the abstraction of a Notification Channel subscriber (consumer),
for the given channel name. |
<T> AcsEventSubscriber<T> |
createNotificationChannelSubscriber(java.lang.String channelName,
java.lang.String channelNotifyServiceDomainName,
java.lang.Class<T> eventType)
Creates a new
AcsEventSubscriber object, which is the abstraction of a Notification Channel subscriber (consumer),
for the given channel name and notify service domain name. |
void |
deactivateOffShoot(java.lang.Object offshootImpl)
Deactivates the offshoot object previously activated through the
#activateOffShoot(Object, Class) method. |
AdvancedContainerServices |
getAdvancedContainerServices()
More specialized methods are available from the
AdvancedContainerServices. |
DAL |
getCDB()
Convenience method for accessing the Configuration Database.
|
AcsLogger |
getLogger()
Gets a
Logger object that the component should use for logging. |
java.lang.String |
getName()
Delivers the unique instance name for the component.
|
org.omg.CORBA.ORB |
getOrb() |
org.omg.PortableServer.POA |
getPOAForOffshoots(org.omg.PortableServer.POA componentPOA) |
java.util.concurrent.ThreadFactory |
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. |
public AlarmSystemContainerServices(AlarmSystemCorbaServer alSysCorbaServer, AcsLogger theLogger)
theOrb - The ORBtheLogger - The loggerpublic <T extends org.omg.PortableServer.Servant & OffShootOperations> OffShoot activateOffShoot(T cbServant)
throws AcsJContainerServicesEx
ContainerServicesBasealma.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.
activateOffShoot in interface ContainerServicesBasecbServant - the CORBA-generated servant, e.g. CBdoublePOA;
must implement alma.ACS.OffShootOperations.CBdouble myCBdouble = alma.ACS.CBdoubleHelper.narrow(...).AcsJContainerServicesExpublic <T> AcsEventPublisher<T> createNotificationChannelPublisher(java.lang.String channelName, java.lang.Class<T> eventType) throws AcsJContainerServicesEx
ContainerServicesBaseAcsEventPublisher object for a given channel.
It is the abstraction of a Corba Notification Channel supplier, a DDS publisher,
or a publisher for some other supported pub/sub technology.
The user is expected to call AcsEventPublisher.disconnect() when the publisher is no longer needed.
To avoid resource problems, the ContainerServices object calls this method during its own deactivation,
just in case the user forgot to do so.
createNotificationChannelPublisher in interface ContainerServicesBasechannelName - The Notification Channel name where events will be published.eventType - The type of event that can be sent using the AcsEventPublisher, e.g. "MySchedulingEvent.class".
Specifying the type offers additional compile time checking.
It should generally be used unless more than one event type must be sent through this publisher,
in which case you can specify a common base type (e.g. "IDLEntity" in case of different IDL-generated structs),
or just "Object" for total type freedom (though the underlying pub-sub framework may later throw runtime exceptions
if unsupported event types get used).AcsJContainerServicesEx - if anything goes wrong while creating the publisherpublic <T> AcsEventPublisher<T> createNotificationChannelPublisher(java.lang.String channelName, java.lang.String channelNotifyServiceDomainName, java.lang.Class<T> eventType) throws AcsJContainerServicesEx
ContainerServicesBaseContainerServicesBase.createNotificationChannelPublisher(String, Class),
but with additional NC domain specification.
Details of this NC domain concept:
createNotificationChannelPublisher in interface ContainerServicesBasechannelNotifyServiceDomainName - The Notification Channel Service Domain name.AcsJContainerServicesEx#createNotificationChannelSubscriber(String, String)public <T> AcsEventSubscriber<T> createNotificationChannelSubscriber(java.lang.String channelName, java.lang.Class<T> eventType) throws AcsJContainerServicesEx
ContainerServicesBaseAcsEventSubscriber object, which is the abstraction of a Notification Channel subscriber (consumer),
for the given channel name.
The created subscriber will be automatically disconnected when the component or client that created it through this method
is finished, in case the user doesn't explicitly do it before.createNotificationChannelSubscriber in interface ContainerServicesBasechannelName - The Notification Channel name to listen toeventType - The type of event that can be sent using the AcsEventSubscriber, e.g. "MySchedulingEvent.class".
The specific event type should be used unless more than one event types must be received by this subscriber,
in which case you can specify a common base type (e.g. "IDLEntity.class" in case of different IDL-generated structs),
or just "Object" for total type freedom (though the underlying pub-sub framework may later throw runtime exceptions
if unsupported event types are received).AcsJContainerServicesEx - if anything goes wrong while creating the subscriberpublic <T> AcsEventSubscriber<T> createNotificationChannelSubscriber(java.lang.String channelName, java.lang.String channelNotifyServiceDomainName, java.lang.Class<T> eventType) throws AcsJContainerServicesEx
ContainerServicesBaseAcsEventSubscriber object, which is the abstraction of a Notification Channel subscriber (consumer),
for the given channel name and notify service domain name.
The created subscriber will be automatically disconnected when the component or client that created it through this method
is finished, in case the user doesn't explicitly do it before.
Details of the NC domain concept:
createNotificationChannelSubscriber in interface ContainerServicesBasechannelName - The Notification Channel name to listen tochannelNotifyServiceDomainName - The Notification Channel Service Domain name.eventType - See ContainerServicesBase.createNotificationChannelPublisher(String, Class).AcsJContainerServicesEx - if anything goes wrong while creating the subscriberpublic org.omg.PortableServer.POA getPOAForOffshoots(org.omg.PortableServer.POA componentPOA)
throws AcsJContainerEx,
AcsJUnexpectedExceptionEx
AcsJContainerExAcsJUnexpectedExceptionExpublic AdvancedContainerServices getAdvancedContainerServices()
ContainerServicesBaseAdvancedContainerServices.getAdvancedContainerServices in interface ContainerServicesBasepublic AcsLogger getLogger()
ContainerServicesBaseLogger 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 AntennaContextLogger.
getLogger in interface ContainerServicesBasepublic java.lang.String getName()
ContainerServicesBasegetName in interface ContainerServicesBasepublic java.util.concurrent.ThreadFactory getThreadFactory()
ContainerServicesBaseThreadFactory, 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 "new Thread(...)" should
not appear anywhere in component code.
The returned thread factory creates new threads configured to run well in the container environment, e.g.
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.
getThreadFactory in interface ContainerServicesBasepublic DAL getCDB()
throws AcsJContainerServicesEx
ContainerServicesBaseCurrently more than a convenience, given that the CDB is not yet a Java component, but a separate service...
getCDB in interface ContainerServicesBaseAcsJContainerServicesExpublic org.omg.CORBA.ORB getOrb()
public void deactivateOffShoot(java.lang.Object offshootImpl)
throws AcsJContainerServicesEx
ContainerServicesBase#activateOffShoot(Object, Class) method.
Caution: this method returns immediately, while the underlying
POAOperations.deactivate_object(byte[]) still
works on the deactivation. If ContainerServicesBase.activateOffShoot(Servant) is called too shortly
after deactivation, an exception will be thrown. TODO: find a remedydeactivateOffShoot in interface ContainerServicesBaseoffshootImpl - the offshoot object implementationAcsJContainerServicesEx - if something goes wrong, e.g., if the corresponding offshoot servant was not active.