public interface ContainerServicesBase
ContainerServices is different from the other services that the container
provides without the component implementation knowing about it.
It can be thought of as a callback handle or a library.
Currently, methods are added to this interface as the functionality becomes available.
At some point we will have to declutter the interface by introducing 2nd-level interfaces
that harbor cohesive functionality. For example, instead of calling
myContainerServices.getComponent(...), the new call will then be something like
myContainerServices.communication().getComponent(...).
created on Oct 24, 2002 12:56:36 PM
| 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 ncDomain,
java.lang.Class<T> eventType)
Similar to
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 ncDomain,
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.
|
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. |
java.lang.String getName()
AcsLogger getLogger()
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 AntennaContextLogger.
DAL getCDB()
throws AcsJContainerServicesEx
Currently more than a convenience, given that the CDB is not yet a Java component, but a separate service...
ContainerExceptionAcsJContainerServicesEx<T extends org.omg.PortableServer.Servant & OffShootOperations> OffShoot activateOffShoot(T cbServant)
throws AcsJContainerServicesEx
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.
cbServant - the CORBA-generated servant, e.g. CBdoublePOA;
must implement alma.ACS.OffShootOperations.CBdouble myCBdouble = alma.ACS.CBdoubleHelper.narrow(...).ContainerException - if anything goes wrong,
especially if cbServant is not an OffShoot.AcsJContainerServicesExvoid deactivateOffShoot(java.lang.Object offshootImpl)
throws AcsJContainerServicesEx
#activateOffShoot(Object, Class) method.
Caution: this method returns immediately, while the underlying
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 remedyoffshootImpl - the offshoot object implementationAcsJContainerServicesEx - if something goes wrong, e.g., if the corresponding offshoot servant was not active.AdvancedContainerServices getAdvancedContainerServices()
AdvancedContainerServices.java.util.concurrent.ThreadFactory getThreadFactory()
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 "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.
<T> AcsEventPublisher<T> createNotificationChannelPublisher(java.lang.String channelName, java.lang.Class<T> eventType) throws AcsJContainerServicesEx
AcsEventPublisher 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.
channelName - 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 publisher<T> AcsEventPublisher<T> createNotificationChannelPublisher(java.lang.String channelName, java.lang.String ncDomain, java.lang.Class<T> eventType) throws AcsJContainerServicesEx
createNotificationChannelPublisher(String, Class),
but with additional NC domain specification.
Details of this NC domain concept:
ncDomain - The Notification Channel Service Domain name.eventType - AcsJContainerServicesEx#createNotificationChannelSubscriber(String, String)<T> AcsEventSubscriber<T> createNotificationChannelSubscriber(java.lang.String channelName, java.lang.Class<T> eventType) throws AcsJContainerServicesEx
AcsEventSubscriber 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.channelName - 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 subscriber<T> AcsEventSubscriber<T> createNotificationChannelSubscriber(java.lang.String channelName, java.lang.String ncDomain, java.lang.Class<T> eventType) throws AcsJContainerServicesEx
AcsEventSubscriber 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:
channelName - The Notification Channel name to listen toncDomain - The Notification Channel Service Domain name.eventType - See createNotificationChannelPublisher(String, Class).AcsJContainerServicesEx - if anything goes wrong while creating the subscriber