Public Member Functions | Protected Member Functions | Protected Attributes | Package Attributes

alma.acs.component.client.ComponentClient Class Reference

Inheritance diagram for alma.acs.component.client.ComponentClient:
alma.acs.component.client.AdvancedComponentClient alma.ACS.MasterComponentImpl.tool.MasterComponentEventLogger alma.contLogTest.client.TestLogLevelsCompClient alma.demo.client.HelloDemoClient alma.demo.client.LampCallbackClient alma.demo.client.LampComponentClient1 alma.demo.client.TimeoutHandlerClient alma.demo.dyncomp.Client

List of all members.

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

Detailed Description

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.

Author:
hsommer Nov 21, 2002 5:53:05 PM

Constructor & Destructor Documentation

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.

Parameters:
logger 
managerLoc 
clientName 
Exceptions:
Exception 
See also:
initRemoteLogging()
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.

Parameters:
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.
Exceptions:
Exception at the slightest provocation...
See also:
initRemoteLogging()

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().


Member Function Documentation

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.

Returns:
ContainerServices

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().


Member Data Documentation


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