public class ComponentClient
extends java.lang.Object
ContainerServices.
Can be used either as a base class or as a delegate object.
Note that this class is only meant to be used within a stand-alone application that needs to communicate with ACS-based components. It is definitely not meant to be used by a component running inside an ACS container.
| Modifier and Type | Field and Description |
|---|---|
protected AcsLogger |
m_logger |
protected ShutdownHookBase |
m_shutdownHook |
| Modifier | Constructor and Description |
|---|---|
|
ComponentClient(java.util.logging.Logger logger,
java.lang.String managerLoc,
java.lang.String clientName)
Normal constructor.
|
protected |
ComponentClient(java.util.logging.Logger logger,
java.lang.String managerLoc,
java.lang.String clientName,
AcsCorba externalAcsCorba)
Special c'tor that provides an already initialized instance of
AcsCorba which encapsulates the ORB. |
| Modifier and Type | Method and Description |
|---|---|
ContainerServices |
getContainerServices()
Gives access to the
ContainerServices interface. |
protected void |
initAlarmSystem()
Initializes the alarm system, using
ACSAlarmSystemInterfaceFactory.init(alma.acs.container.ContainerServicesBase). |
void |
initRemoteLogging()
Sets up the client logger(s) to send log records to the remote log service.
|
protected void |
registerShutdownHook()
Default shutdown hook is used to complain if the application forgot to call tearDown().
|
void |
tearDown()
Must be called by the application that uses this class, when it is done using ACS components.
|
protected void |
tearDownAlarmSystem()
Stops and cleans up the alarm system, using
ACSAlarmSystemInterfaceFactory.done(). |
protected final AcsLogger m_logger
protected ShutdownHookBase m_shutdownHook
public ComponentClient(java.util.logging.Logger logger,
java.lang.String managerLoc,
java.lang.String clientName)
throws java.lang.Exception
logger - managerLoc - clientName - java.lang.ExceptioninitRemoteLogging()protected ComponentClient(java.util.logging.Logger logger,
java.lang.String managerLoc,
java.lang.String clientName,
AcsCorba externalAcsCorba)
throws java.lang.Exception
AcsCorba which encapsulates the ORB.
This may be useful for an application such as the ALMA executive, which works with different ORBs, tries out
available ports, and so on.
With this constructor, also initialization and termination of remote ACS logging is left to the caller.
logger - the logger to be used. If null, one will be created. Since ACS 8.0 it is recommended to
supply null or an AcsLogger instead of a plain JDK Logger because a plain Logger
will have to be wrapped inside this method.managerLoc - the corbaloc for the ACS manager, e.g. "corbaloc::myhost:xxxx/Manager"clientName - name to be used toward the ACS ManagerexternalAcsCorba - encapsulates initialized ORB and POAs.java.lang.Exception - at the slightest provocation...initRemoteLogging()protected void registerShutdownHook()
protected void initAlarmSystem()
throws java.lang.Exception
ACSAlarmSystemInterfaceFactory.init(alma.acs.container.ContainerServicesBase).
Override this method only in special cases such as the eventGUI, when a client does not need to access the alarm system
and has special classpath problems with the CERN alarm system jar files.java.lang.ExceptiontearDownAlarmSystem()protected void tearDownAlarmSystem()
ACSAlarmSystemInterfaceFactory.done().
Override this method only in special cases such as the eventGUI, when a client does not need to access the alarm system
and has special classpath problems with the CERN alarm system jar files.initAlarmSystem()public void initRemoteLogging()
Makes repeated attempts to connect to the remote logger. If they fail unexpectedly, remote logging will be disabled.
If the ComponentClient has been constructed without an external AcsCorba object
(the normal case), then this method is called automatically.
Otherwise (with an external AcsCorba object provided) it is assumed that also
remote logging is controlled from outside of this class. If nonetheless you want to
initialize remote logging, you may explicitly call this method for convenience.
Override this method to prevent remote logging (useful only if AcsCorba is is not provided externally).
public ContainerServices getContainerServices()
ContainerServices interface.
This class plays the part of the role of the Java container that has to do with
providing explicit services to the component, or test case respectively.
public void tearDown()
throws java.lang.Exception
Releases all previously obtained components (using manager), and logs out from the manager.
It also stops remote logging and terminates the CORBA ORB
unless an AcsCorba instance was provided in the c'tor;
otherwise the application remains responsible to clean up logging and the ORB.
java.lang.Exception