

Public Member Functions | |
| HeartbeatHelper (AlarmSelectionListener selectionListener) throws LaserException | |
| void | startHeartbeatCheck () throws LaserException |
| void | stopHeartbeatCheck () throws LaserException |
| void | onException (MOMException e) |
Private Member Functions | |
| void | initHeartbeatCheck () throws LaserException, LaserConnectionException |
| SubscriptionListener | getHeartbeatListener () |
| TimerTask | createHeartbeatTimerTask () |
| void | checkHeartbeat () |
| synchronized void | resetHeartbeatReceptionTime () |
| synchronized long | getHeartbeatReceptionTime () |
| synchronized void | setHeartbeatReceived (boolean value) |
| synchronized boolean | isHeartbeatReceived () |
| Subscriber | getSubscriber () throws LaserException |
Private Attributes | |
| SubscriptionListener | heartbeatListener = null |
| AlarmSelectionListener | selectionListener = null |
| Timer | timer = null |
| String | heartbeatTopic = null |
| long | heartbeatFrequency = -1 |
| long | heartbeatCheckFrequency = -1 |
| boolean | heartbeatReceived = false |
| long | heartbeatReceptionTime = -1 |
| Subscriber | cmwSubscriber |
| boolean | cmwConnected = true |
| CERNAlarmService | m_laser |
Static Private Attributes | |
| static final Logger | LOGGER = Logger.getLogger(HeartbeatHelper.class.getName()) |
| static final String | HEARTBEAT_PROPERTY = "HEARTBEAT" |
| static final String | SQL_FILTER = "HEARTBEAT = TRUE" |
This class subscribes to the heartbeat from the business layer and verifies that it arrives in time. If it doesn't the AlarmSelectionListener is informed. It is a helper class for the AlarmSelectionHandler.
| cern::laser::client::impl::services::selection::HeartbeatHelper::HeartbeatHelper | ( | AlarmSelectionListener | selectionListener | ) | throws LaserException [inline] |
| sessionEJB |
| LaserException | ||
| LaserException | ||
| LaserConnectionException |
References alma::alarmsystem::CERNAlarmServiceOperations::getHeartbeatFrequency(), alma::alarmsystem::CERNAlarmServiceOperations::getHeartbeatTopic(), heartbeatCheckFrequency, heartbeatFrequency, heartbeatTopic, initHeartbeatCheck(), m_laser, and selectionListener.
| void cern::laser::client::impl::services::selection::HeartbeatHelper::checkHeartbeat | ( | ) | [inline, private] |
| TimerTask cern::laser::client::impl::services::selection::HeartbeatHelper::createHeartbeatTimerTask | ( | ) | [inline, private] |
References checkHeartbeat(), and LOGGER.
Referenced by startHeartbeatCheck().
| SubscriptionListener cern::laser::client::impl::services::selection::HeartbeatHelper::getHeartbeatListener | ( | ) | [inline, private] |
References heartbeatListener, LOGGER, and resetHeartbeatReceptionTime().
Referenced by initHeartbeatCheck().
| synchronized long cern::laser::client::impl::services::selection::HeartbeatHelper::getHeartbeatReceptionTime | ( | ) | [inline, private] |
References heartbeatReceptionTime.
Referenced by checkHeartbeat().
| Subscriber cern::laser::client::impl::services::selection::HeartbeatHelper::getSubscriber | ( | ) | throws LaserException [inline, private] |
References cmwSubscriber, and cern::cmw::mom::pubsub::Subscriber::setExceptionListener().
Referenced by initHeartbeatCheck().
| void cern::laser::client::impl::services::selection::HeartbeatHelper::initHeartbeatCheck | ( | ) | throws LaserException, LaserConnectionException [inline, private] |
| LaserException | ||
| LaserConnectionException |
References getHeartbeatListener(), getSubscriber(), heartbeatTopic, resetHeartbeatReceptionTime(), selectionListener, setHeartbeatReceived(), SQL_FILTER, and cern::cmw::mom::pubsub::Subscriber::subscribe().
Referenced by HeartbeatHelper().
| synchronized boolean cern::laser::client::impl::services::selection::HeartbeatHelper::isHeartbeatReceived | ( | ) | [inline, private] |
References heartbeatReceived.
Referenced by checkHeartbeat().
| void cern::laser::client::impl::services::selection::HeartbeatHelper::onException | ( | MOMException | e | ) | [inline] |
The exception handler called in case of communication exception
| e | the MOMException caught |
Implements cern::cmw::mom::pubsub::ExceptionListener.
References cmwConnected, cern::laser::client::services::selection::AlarmSelectionListener::onException(), selectionListener, and cern::cmw::mom::pubsub::MOMException::testException().
| synchronized void cern::laser::client::impl::services::selection::HeartbeatHelper::resetHeartbeatReceptionTime | ( | ) | [inline, private] |
References heartbeatReceptionTime.
Referenced by getHeartbeatListener(), and initHeartbeatCheck().
| synchronized void cern::laser::client::impl::services::selection::HeartbeatHelper::setHeartbeatReceived | ( | boolean | value | ) | [inline, private] |
References heartbeatReceived.
Referenced by checkHeartbeat(), and initHeartbeatCheck().
| void cern::laser::client::impl::services::selection::HeartbeatHelper::startHeartbeatCheck | ( | ) | throws LaserException [inline] |
| void cern::laser::client::impl::services::selection::HeartbeatHelper::stopHeartbeatCheck | ( | ) | throws LaserException [inline] |
boolean cern::laser::client::impl::services::selection::HeartbeatHelper::cmwConnected = true [private] |
Referenced by onException().
Referenced by getSubscriber(), and stopHeartbeatCheck().
final String cern::laser::client::impl::services::selection::HeartbeatHelper::HEARTBEAT_PROPERTY = "HEARTBEAT" [static, private] |
long cern::laser::client::impl::services::selection::HeartbeatHelper::heartbeatCheckFrequency = -1 [private] |
Referenced by HeartbeatHelper(), startHeartbeatCheck(), and stopHeartbeatCheck().
long cern::laser::client::impl::services::selection::HeartbeatHelper::heartbeatFrequency = -1 [private] |
Referenced by checkHeartbeat(), HeartbeatHelper(), and stopHeartbeatCheck().
SubscriptionListener cern::laser::client::impl::services::selection::HeartbeatHelper::heartbeatListener = null [private] |
Referenced by getHeartbeatListener().
boolean cern::laser::client::impl::services::selection::HeartbeatHelper::heartbeatReceived = false [private] |
Referenced by isHeartbeatReceived(), and setHeartbeatReceived().
long cern::laser::client::impl::services::selection::HeartbeatHelper::heartbeatReceptionTime = -1 [private] |
Referenced by getHeartbeatReceptionTime(), and resetHeartbeatReceptionTime().
String cern::laser::client::impl::services::selection::HeartbeatHelper::heartbeatTopic = null [private] |
Referenced by HeartbeatHelper(), initHeartbeatCheck(), and stopHeartbeatCheck().
final Logger cern::laser::client::impl::services::selection::HeartbeatHelper::LOGGER = Logger.getLogger(HeartbeatHelper.class.getName()) [static, private] |
Referenced by checkHeartbeat(), createHeartbeatTimerTask(), getHeartbeatListener(), startHeartbeatCheck(), and stopHeartbeatCheck().
Referenced by HeartbeatHelper().
AlarmSelectionListener cern::laser::client::impl::services::selection::HeartbeatHelper::selectionListener = null [private] |
Referenced by checkHeartbeat(), HeartbeatHelper(), initHeartbeatCheck(), and onException().
final String cern::laser::client::impl::services::selection::HeartbeatHelper::SQL_FILTER = "HEARTBEAT = TRUE" [static, private] |
Referenced by initHeartbeatCheck().
Timer cern::laser::client::impl::services::selection::HeartbeatHelper::timer = null [private] |
Referenced by startHeartbeatCheck(), and stopHeartbeatCheck().
1.6.2