Public Member Functions | |
ComponentClient (Logger logger, String managerLoc, String clientName) throws Exception | |
void | initRemoteLogging () |
ContainerServices | getContainerServices () |
void | tearDown () throws Exception |
Protected Member Functions | |
ComponentClient (Logger logger, String managerLoc, String clientName, AcsCorba externalAcsCorba) throws Exception | |
void | initAlarmSystem () throws Exception |
Protected Attributes | |
final AcsLogger | m_logger |
Package Attributes | |
final String | m_clientName |
AcsManagerProxy | m_acsManagerProxy |
final AcsCorba | acsCorba |
final boolean | ownAcsCorba |
Class that facilitates writing client application that access ACS components. Takes care of the communication with the ACS manager. Provides the 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.
alma.acs.component.client.ComponentClient.ComponentClient | ( | Logger | logger, | |
String | managerLoc, | |||
String | clientName | |||
) | throws Exception |
Normal constructor. The component client will take care of creating ORB and POAs, and of setting up remote logging.
logger | ||
managerLoc | ||
clientName |
Exception |
alma.acs.component.client.ComponentClient.ComponentClient | ( | Logger | logger, | |
String | managerLoc, | |||
String | clientName, | |||
AcsCorba | externalAcsCorba | |||
) | throws Exception [protected] |
Special c'tor that provides an already initialized instance of 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 Manager | |
externalAcsCorba | encapsulates initialized ORB and POAs. |
Exception | at the slightest provocation... |
References alma.acs.component.client.ComponentClient.acsCorba, alma.acs.logging.AcsLogger.fromJdkLogger(), alma.acs.container.corba.AcsCorba.getRootPOA(), alma.acs.container.corba.AcsCorba.initCorbaForClient(), alma.acs.component.client.ComponentClient.initRemoteLogging(), alma.acs.component.client.ComponentClient.m_clientName, alma.acs.component.client.ComponentClient.m_logger, alma.acs.component.client.ComponentClient.ownAcsCorba, and alma.acs.component.client.ComponentClient.tearDown().
ContainerServices alma.acs.component.client.ComponentClient.getContainerServices | ( | ) |
Gives access to the 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.
Referenced by alma.alarmsystemdemo.client.AlarmSystemClient.AlarmSystemClient(), alma.demo.dyncomp.Client.cleanExit(), alma.demo.client.TimeoutHandlerClient.doSomeStuff(), alma.contLogTest.client.TestLogLevelsCompClient.doSomeStuff(), alma.demo.client.HelloDemoClient.doSomeStuff(), alma.acs.alarmsanalyzer.engine.AcsSourceClient.getCDB(), alma.acs.alarmsanalyzer.engine.AcsSourceClient.getContainerServices(), cl.utfsm.samplingSystemUI.core.AcsInformation.getContainerServices(), cl.utfsm.acs.acg.core.AcsInformation.getContainerServices(), cl.utfsm.acs.acg.core.AcsInformation.getDAL(), alma.demo.dyncomp.Client.getDynamicComponent(), alma.acs.alarmsanalyzer.engine.AcsSourceClient.getLogger(), cl.utfsm.acs.acg.core.AcsInformation.getLogger(), alma.demo.client.LampCallbackClient.LampCallbackClient(), alma.demo.client.LampComponentClient1.LampComponentClient1(), alma.contLogTest.client.TestLogLevelsCompClient.main(), alma.ACSCOURSE_MOUNT.MountSupplier.main(), alma.ACSCOURSE_MOUNT.MountConsumer.main(), alma.demo.client.HelloDemoClient.main(), alma.demo.dyncomp.Client.releaseComponent(), alma.alarmsystemdemo.listener.SourcesListener.SourcesListener(), alma.demo.client.TimeoutHandlerClient.TimeoutHandlerClient(), and alma.demo.client.guiapps.XmlComponentGui.XmlComponentGui().
void alma.acs.component.client.ComponentClient.initAlarmSystem | ( | ) | throws Exception [protected] |
Initializes the alarm system, using 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.
void alma.acs.component.client.ComponentClient.initRemoteLogging | ( | ) |
Sets up the client logger(s) to send log records to the remote log service. This method starts a separate thread and returns immediately.
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).
References alma.acs.component.client.ComponentClient.acsCorba, alma.acs.container.AcsManagerProxy.getManager(), alma.acs.container.AcsManagerProxy.getManagerHandle(), alma.acs.container.corba.AcsCorba.getORB(), alma.acs.logging.AcsLogger.log(), alma.acs.component.client.ComponentClient.m_acsManagerProxy, and alma.acs.component.client.ComponentClient.m_logger.
Referenced by alma.acs.component.client.ComponentClient.ComponentClient().
void alma.acs.component.client.ComponentClient.tearDown | ( | ) | throws Exception |
Must be called by the application that uses this class, when it is done using ACS components. At the latest it should be called when the application itself terminates.
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.
References alma.acs.component.client.ComponentClient.acsCorba, alma.acs.container.CleaningDaemonThreadFactory.cleanUp(), alma.acs.container.ContainerServicesImpl.cleanUp(), alma.acs.container.corba.AcsCorba.doneCorba(), alma.acs.container.AcsManagerProxy.logoutFromManager(), alma.acs.component.client.ComponentClient.m_acsManagerProxy, alma.acs.component.client.ComponentClient.m_clientName, alma.acs.component.client.ComponentClient.m_logger, alma.acs.component.client.ComponentClient.ownAcsCorba, alma.acs.container.ContainerServicesImpl.releaseAllComponents(), alma.acs.shutdown.ShutdownHookBase.setRegularShutdownExpected(), alma.acs.container.AcsManagerProxy.shutdownNotify(), and alma.acs.container.corba.AcsCorba.shutdownORB().
Referenced by alma.acs.component.client.ComponentClient.ComponentClient(), cl.utfsm.acs.acg.core.AcsInformation.disconnect(), alma.demo.client.TimeoutHandlerClient.main(), alma.contLogTest.client.TestLogLevelsCompClient.main(), alma.ACSCOURSE_MOUNT.MountSupplier.main(), alma.ACSCOURSE_MOUNT.MountConsumer.main(), alma.ACS.MasterComponentImpl.tool.MasterComponentEventLogger.main(), alma.demo.client.LampComponentClient1.main(), alma.demo.client.LampCallbackClient.main(), alma.demo.client.HelloDemoClient.main(), alma.acs.commandcenter.meta.Firestarter.shutdown(), alma.acs.alarmsanalyzer.engine.AcsSourceClient.shutdown(), cl.utfsm.samplingSystemUI.core.AcsInformation.shutDown(), and alma.demo.client.guiapps.XmlComponentGui.XmlComponentGui().
final AcsCorba alma.acs.component.client.ComponentClient.acsCorba [package] |
The instance of AcsCorba to be used by this class for all CORBA activities.
Referenced by alma.acs.component.client.ComponentClient.ComponentClient(), alma.acs.component.client.AdvancedComponentClient.createContainerServices(), alma.acs.component.client.AdvancedComponentClient.getAcsCorba(), alma.acs.component.client.ComponentClient.initRemoteLogging(), and alma.acs.component.client.ComponentClient.tearDown().
final String alma.acs.component.client.ComponentClient.m_clientName [package] |
final AcsLogger alma.acs.component.client.ComponentClient.m_logger [protected] |
Referenced by alma.acs.component.client.ComponentClient.ComponentClient(), alma.contLogTest.client.TestLogLevelsCompClient.doSomeStuff(), alma.demo.client.LampCallbackClient.doSomeStuff(), alma.demo.client.HelloDemoClient.doSomeStuff(), alma.acs.component.client.ComponentClient.initRemoteLogging(), and alma.acs.component.client.ComponentClient.tearDown().
final boolean alma.acs.component.client.ComponentClient.ownAcsCorba [package] |