Classes | |
| class | ShutdownHook |
Public Member Functions | |
| AlarmDumperBase (Logger theLogger, String mangerLoc, String clientname) throws Exception | |
| abstract void | startReceivingAlarms () throws Exception |
| void | receiveAlarms () throws Exception |
| void | receiveAlarms (long timeout, TimeUnit timeUnit) throws Exception |
| abstract void | close () throws Exception |
| synchronized void | tearDown () |
| String | formatTimestamp (Timestamp timestamp) |
Static Public Member Functions | |
| static void | clientRunner (String[] args, boolean isSourceClient, long timeout, TimeUnit timeUnit) |
Protected Member Functions | |
| void | registerShutdownHook () |
The base class of the alarm dumper. It groups common code for the dumpers that write XML alarms, from sources or categories, in the stdout.
The pattern for using a dumper is:
call tearDown()
receiveAlarms() blocks until the user presses CTRL-C a signal is received or tearDown() is called.
receiveAlarms(long, TimeUnit) can be used instead of receiveAlarms() if the receiving has to terminate after the specified timeout.
tearDown() must be called before terminating to cleanly exit.
| alma.alarmsystem.dump.AlarmDumperBase.AlarmDumperBase | ( | Logger | theLogger, | |
| String | mangerLoc, | |||
| String | clientname | |||
| ) | throws Exception |
Constructor
| theLogger | The logger | |
| mangerLoc | The CORBA loc of the manager | |
| clientname | The name of the client |
| Exception | if an error happens instantiating the AdvancedComponentClient |
| static void alma.alarmsystem.dump.AlarmDumperBase.clientRunner | ( | String[] | args, | |
| boolean | isSourceClient, | |||
| long | timeout, | |||
| TimeUnit | timeUnit | |||
| ) | [static] |
This block of code avoid code replication.
| args | Command line args | |
| isSourceClient | true if a source client must be instantiated, false for category client | |
| timeout | If greater then 0 the process waits until the timeout elapses | |
| timeUnit | The TimeUnit for the timeout (must be not null if the timeout is greater then 0) |
References alma.alarmsystem.dump.AlarmDumperBase.receiveAlarms(), and alma.alarmsystem.dump.AlarmDumperBase.tearDown().
| abstract void alma.alarmsystem.dump.AlarmDumperBase.close | ( | ) | throws Exception [pure virtual] |
Close the resources of the alarm client
Referenced by alma.alarmsystem.dump.AlarmDumperBase.tearDown().
| String alma.alarmsystem.dump.AlarmDumperBase.formatTimestamp | ( | Timestamp | timestamp | ) |
Return the timestamp in ISO format.
| timestamp |
Referenced by alma.alarmsystem.dump.AlarmSourceDumper.faultStateReceived(), and alma.alarmsystem.dump.AlarmCategoryDumper.onAlarm().
| void alma.alarmsystem.dump.AlarmDumperBase.receiveAlarms | ( | ) | throws Exception |
Connect the client
This method never stops.
| Exception | In case of error connecting the SourceClient |
References alma.acs.component.client.ComponentClient.m_logger, and alma.alarmsystem.dump.AlarmDumperBase.startReceivingAlarms().
Referenced by alma.alarmsystem.dump.AlarmDumperBase.clientRunner().
| void alma.alarmsystem.dump.AlarmDumperBase.receiveAlarms | ( | long | timeout, | |
| TimeUnit | timeUnit | |||
| ) | throws Exception |
Connect the client until the timeout elapses or the user presses CTRL-C
This method never when the timeout elapse or the user presses CTRL-C
| Exception | In case of error connecting the SourceClient |
References alma.acs.component.client.ComponentClient.m_logger, and alma.alarmsystem.dump.AlarmDumperBase.startReceivingAlarms().
| void alma.alarmsystem.dump.AlarmDumperBase.registerShutdownHook | ( | ) | [protected] |
AlarmDumperBase registers its own shutdown hook in fact what is provided by ComponentClient logs a few warnings if the process is interrupted but in this case the situation is absolutely normal.
Reimplemented from alma.acs.component.client.ComponentClient.
References alma.acs.component.client.ComponentClient.m_shutdownHook.
| abstract void alma.alarmsystem.dump.AlarmDumperBase.startReceivingAlarms | ( | ) | throws Exception [pure virtual] |
Connects to the NC and start receiving alarms.
This must be implemented to connect to the right NC. If the connection failed, startReceivingAlarms() must thrown an exception
Referenced by alma.alarmsystem.dump.AlarmDumperBase.receiveAlarms().
| synchronized void alma.alarmsystem.dump.AlarmDumperBase.tearDown | ( | ) |
Cleanly tear down
Reimplemented from alma.acs.component.client.ComponentClient.
References alma.alarmsystem.dump.AlarmDumperBase.close(), and alma.acs.component.client.ComponentClient.m_logger.
Referenced by alma.alarmsystem.dump.AlarmDumperBase.clientRunner().
1.7.0