

Public Member Functions | |
| LogDetailsDispatcher () | |
| void | errorReceived (String xml) |
| void | xmlEntryReceived (String xmlLogString) |
| void | acsLogConnConnecting () |
| void | acsLogConnDisconnected () |
| void | acsLogConnEstablished () |
| void | acsLogConnLost () |
| void | acsLogConnSuspended () |
| void | acsLogsDelay () |
| void | reportStatus (String status) |
| void | logEntryReceived (ILogEntry logEntry) |
| void | addNumsListener (LogNumbersListener listener) |
| void | removeNumsListener (LogNumbersListener listener) |
| void | run () |
| void | close () |
Static Public Attributes | |
| static final int | NUMBER_LISTENERS_INTERVAL = 10 |
Private Attributes | |
| final int[] | receivedLogNums = new int[LogTypeHelper.values().length] |
| final long[] | totalLogs = new long[LogTypeHelper.values().length] |
| int | longestLogSize = Integer.MIN_VALUE |
| int | shortestLogSize = Integer.MAX_VALUE |
| int | errors = 0 |
| final TotalStatsData | totData = new TotalStatsData() |
| final LCEngine | engine |
| final Vector< LogNumbersListener > | numListeners = new Vector<LogNumbersListener>() |
| final Thread | notifierThread |
| boolean | terminateThread = false |
LogDetailsDispatcher reads logs from the logging NC and dispatch them to the registered listeners.
There are 2 types of listeners to perform different kind of statistics:
| alma::acs::logtools::monitor::LogDetailsDispatcher::LogDetailsDispatcher | ( | ) | [inline] |
Constructor
References com::cosylab::logging::engine::ACS::LCEngine::addLogConnectionListener(), com::cosylab::logging::engine::ACS::LCEngine::addLogErrorListener(), com::cosylab::logging::engine::ACS::LCEngine::addLogListener(), com::cosylab::logging::engine::ACS::LCEngine::addRawLogListener(), com::cosylab::logging::engine::ACS::LCEngine::connect(), engine, and notifierThread.
| void alma::acs::logtools::monitor::LogDetailsDispatcher::acsLogConnConnecting | ( | ) | [inline] |
Notify that an attempt to connect to ACS NC is in progress
Implements com::cosylab::logging::engine::ACS::ACSLogConnectionListener.
| void alma::acs::logtools::monitor::LogDetailsDispatcher::acsLogConnDisconnected | ( | ) | [inline] |
Notify that the connection with ACS NC has been disconnected It can happen as a consequence of an error as well as as consequence of a request
Implements com::cosylab::logging::engine::ACS::ACSLogConnectionListener.
| void alma::acs::logtools::monitor::LogDetailsDispatcher::acsLogConnEstablished | ( | ) | [inline] |
Notify that the connection with ACS NC has been established
Implements com::cosylab::logging::engine::ACS::ACSLogConnectionListener.
| void alma::acs::logtools::monitor::LogDetailsDispatcher::acsLogConnLost | ( | ) | [inline] |
Notify that the connection with ACS NC has been lost (it means an error or something abnormal).
Implements com::cosylab::logging::engine::ACS::ACSLogConnectionListener.
| void alma::acs::logtools::monitor::LogDetailsDispatcher::acsLogConnSuspended | ( | ) | [inline] |
Notify that the service is supended (i.e. it is connected to the NC and receiving logs but the logs are discarded instead of being sent to the listeners) Note: the suspension of the service is not a malfunctioning but a status requested by the user
Implements com::cosylab::logging::engine::ACS::ACSLogConnectionListener.
| void alma::acs::logtools::monitor::LogDetailsDispatcher::acsLogsDelay | ( | ) | [inline] |
Notify that for some internal reason the service is not able to follow the flow of the incoming logs and is queueing the messages to be inserted later, when flow will decrease and enough CPU time is availbale
This method is not executed each time a log is queued but once when the situation begins. When the temporary problem has been fixed, the status will revert to connected
Implements com::cosylab::logging::engine::ACS::ACSLogConnectionListener.
| void alma::acs::logtools::monitor::LogDetailsDispatcher::addNumsListener | ( | LogNumbersListener | listener | ) | [inline] |
Add a LogNumbersListener listener to be notified about incoming logs statistics
| listener | The listener to add |
References numListeners.
Referenced by alma::acs::logtools::monitor::LogMonitor::LogMonitor().
| void alma::acs::logtools::monitor::LogDetailsDispatcher::close | ( | ) | [inline] |
Close the engine and free the resources
References com::cosylab::logging::engine::ACS::LCEngine::close(), engine, notifierThread, and terminateThread.
Referenced by alma::acs::logtools::monitor::LogMonitor::close().
| void alma::acs::logtools::monitor::LogDetailsDispatcher::errorReceived | ( | String | xml | ) | [inline] |
The method is executed when an error happened building a log from a string.
The parameter is the string that caused the error and it can be
The cache string is a string used in the cache whose format might change with different implementation of of the cache.
| xml | That string that caused the error |
Implements com::cosylab::logging::engine::ACS::ACSRemoteErrorListener.
References errors, totData, and alma::acs::logtools::monitor::TotalStatsData::updateErrors().
| void alma::acs::logtools::monitor::LogDetailsDispatcher::logEntryReceived | ( | ILogEntry | logEntry | ) | [inline] |
The method is executed when a new log arrives from the NC
| logEntry | The new log just read from the NC |
Implements com::cosylab::logging::engine::ACS::ACSRemoteLogListener.
References com::cosylab::logging::engine::log::ILogEntry::getType(), receivedLogNums, totalLogs, totData, and alma::acs::logtools::monitor::TotalStatsData::updateTotalLogs().
| void alma::acs::logtools::monitor::LogDetailsDispatcher::removeNumsListener | ( | LogNumbersListener | listener | ) | [inline] |
Remove a LogNumbersListener listener.
| listener | The listener to remove |
References numListeners.
Referenced by alma::acs::logtools::monitor::LogMonitor::close().
| void alma::acs::logtools::monitor::LogDetailsDispatcher::reportStatus | ( | String | status | ) | [inline] |
Send a report string with the current status of the connection
| status | The status string |
Implements com::cosylab::logging::engine::ACS::ACSLogConnectionListener.
| void alma::acs::logtools::monitor::LogDetailsDispatcher::run | ( | ) | [inline] |
The thread notifying listeners about statistics
References NUMBER_LISTENERS_INTERVAL, numListeners, receivedLogNums, terminateThread, and totData.
| void alma::acs::logtools::monitor::LogDetailsDispatcher::xmlEntryReceived | ( | String | xmlLogString | ) | [inline] |
The method is executed when a new XML string arrives from the NC
| xmlLogString | The new XML string just read from the NC |
Implements com::cosylab::logging::engine::ACS::ACSRemoteRawLogListener.
References longestLogSize, shortestLogSize, totData, and alma::acs::logtools::monitor::TotalStatsData::updateSizes().
final LCEngine alma::acs::logtools::monitor::LogDetailsDispatcher::engine [private] |
The engine to receive logs from the logging NC
Referenced by close(), and LogDetailsDispatcher().
int alma::acs::logtools::monitor::LogDetailsDispatcher::errors = 0 [private] |
Number of errors parsing logs since the begging of the execution
Referenced by errorReceived().
int alma::acs::logtools::monitor::LogDetailsDispatcher::longestLogSize = Integer.MIN_VALUE [private] |
The longest XML log received since the begging of the execution
Referenced by xmlEntryReceived().
final Thread alma::acs::logtools::monitor::LogDetailsDispatcher::notifierThread [private] |
The thread to notify listeners about statistics
Referenced by close(), and LogDetailsDispatcher().
final int alma::acs::logtools::monitor::LogDetailsDispatcher::NUMBER_LISTENERS_INTERVAL = 10 [static] |
The interval of time (seconds) to notify listener of numbers
Referenced by run().
final Vector<LogNumbersListener> alma::acs::logtools::monitor::LogDetailsDispatcher::numListeners = new Vector<LogNumbersListener>() [private] |
The listeners of numbers
Referenced by addNumsListener(), removeNumsListener(), and run().
final int [] alma::acs::logtools::monitor::LogDetailsDispatcher::receivedLogNums = new int[LogTypeHelper.values().length] [private] |
The number of each received log in the NUMBER_LISTENERS_INTERVAL time interval.
One entry for each log type.
Referenced by logEntryReceived(), and run().
int alma::acs::logtools::monitor::LogDetailsDispatcher::shortestLogSize = Integer.MAX_VALUE [private] |
The shortest XML log received since the begging of the execution
Referenced by xmlEntryReceived().
boolean alma::acs::logtools::monitor::LogDetailsDispatcher::terminateThread = false [private] |
final long [] alma::acs::logtools::monitor::LogDetailsDispatcher::totalLogs = new long[LogTypeHelper.values().length] [private] |
The total number of logs received since the begging of the execution
One entry for each log type.
Referenced by logEntryReceived().
final TotalStatsData alma::acs::logtools::monitor::LogDetailsDispatcher::totData = new TotalStatsData() [private] |
The total numbers read since when the application started
Referenced by errorReceived(), logEntryReceived(), run(), and xmlEntryReceived().
1.6.2