

Classes | |
| class | MyStateChangeSemaphore |
Public Member Functions | |
| StateChangeListener (Logger logger) | |
| StateChangeSemaphore | getStateChangeSemaphore () |
| MonitorstringSeq | createMonitor (ROstringSeq statesProperty, ContainerServices contSrv) throws Exception |
| void | destroyMonitor () throws Exception |
| final void | working (String[] value, Completion completion, CBDescOut desc) |
| void | done (String[] value, Completion completion, CBDescOut desc) |
| boolean | negotiate (long timeout, CBDescOut desc) |
| String[] | getCurrentState () throws AcsJIllegalStateEventEx |
| boolean | verifyCurrentState (String[] expectedHierarchy) |
Protected Member Functions | |
| void | stateChangedNotification (String[] newStateHierarchy) |
| void | logNotification (String[] value, Completion completion) |
Protected Attributes | |
| final Logger | logger |
Private Attributes | |
| ROstringSeq | statesProperty |
| MonitorstringSeq | monitor |
| ContainerServices | contSrv |
| final MyStateChangeSemaphore | stateChangeSemaphore |
Convenience implementation of a subsystem state change listener. Encapsulates the activation as a callback object, the registration as a monitor of the master component state property, and the reception of state change notifications.
Can be subclassed (see stateChangedNotification(String[])).
| alma::ACS::MasterComponentImpl::StateChangeListener::StateChangeListener | ( | Logger | logger | ) | [inline] |
References stateChangeSemaphore.
| MonitorstringSeq alma::ACS::MasterComponentImpl::StateChangeListener::createMonitor | ( | ROstringSeq | statesProperty, | |
| ContainerServices | contSrv | |||
| ) | throws Exception [inline] |
Creates a monitor for statesProperty from this instance.
| statesProperty | ||
| contSrv |
| Exception |
References alma::acs::container::ContainerServicesBase::activateOffShoot(), contSrv, alma::ACS::PstringSeqOperations::create_monitor(), destroyMonitor(), monitor, alma::ACS::MonitorOperations::set_timer_trigger(), alma::ACS::MonitorstringSeqOperations::set_value_trigger(), and statesProperty.
Referenced by alma::ACS::MasterComponentImpl::tool::MasterComponentEventLogger::attachListener(), alma::ACS::MasterComponentImpl::MasterComponentImplBase::initialize(), alma::ACS::MasterComponentImpl::MasterComponentTest::testEventSyncMultipleRuns(), and alma::ACS::SpecialTestMasterComponentImpl::SpecialTestMasterComponentTest::testHealthySubsystemLifecycle().
| void alma::ACS::MasterComponentImpl::StateChangeListener::destroyMonitor | ( | ) | throws Exception [inline] |
| Exception |
References contSrv, alma::acs::container::ContainerServicesBase::deactivateOffShoot(), alma::ACS::SubscriptionOperations::destroy(), and monitor.
Referenced by alma::ACS::MasterComponentImpl::tool::MasterComponentEventLogger::checkCurrentMasterComponents(), alma::ACS::MasterComponentImpl::MasterComponentImplBase::cleanUp(), createMonitor(), alma::ACS::MasterComponentImpl::MasterComponentTest::testEventSyncMultipleRuns(), and alma::ACS::SpecialTestMasterComponentImpl::SpecialTestMasterComponentTest::testHealthySubsystemLifecycle().
| void alma::ACS::MasterComponentImpl::StateChangeListener::done | ( | String[] | value, | |
| Completion | completion, | |||
| CBDescOut | desc | |||
| ) | [inline] |
References logger.
| String [] alma::ACS::MasterComponentImpl::StateChangeListener::getCurrentState | ( | ) | throws AcsJIllegalStateEventEx [inline] |
Reads the current state hierarchy.
| AcsJIllegalStateEventEx | if the state can't be read ; : use better fitting ex (don't want to create one now right before the release) |
References alma::ACS::PstringSeqOperations::get_sync(), alma::acs::exceptions::AcsJCompletion::getCode(), alma::acs::exceptions::AcsJCompletion::getType(), alma::acs::exceptions::AcsJCompletion::isError(), statesProperty, and alma::ACSErr::CompletionHolder::value.
Referenced by verifyCurrentState().
| StateChangeSemaphore alma::ACS::MasterComponentImpl::StateChangeListener::getStateChangeSemaphore | ( | ) | [inline] |
Creates a semaphore that can be used to wait for a given number of state changes. Useful to wait with sending the next event until a previous action state has finished its /do method, and moved on to the next state.
References stateChangeSemaphore.
Referenced by alma::ACS::SpecialTestMasterComponentImpl::SpecialTestMasterComponentTest::testHealthySubsystemLifecycle().
| void alma::ACS::MasterComponentImpl::StateChangeListener::logNotification | ( | String[] | value, | |
| Completion | completion | |||
| ) | [inline, protected] |
Logs a state change notification.
| value | the new state hierarchy | |
| completion | an optional completion |
References alma::acs::exceptions::AcsJCompletion::getAcsJException(), alma::acs::exceptions::AcsJCompletion::isError(), logger, and alma::acs::exceptions::AcsJException::toString().
Referenced by stateChangedNotification().
| boolean alma::ACS::MasterComponentImpl::StateChangeListener::negotiate | ( | long | timeout, | |
| CBDescOut | desc | |||
| ) | [inline] |
| void alma::ACS::MasterComponentImpl::StateChangeListener::stateChangedNotification | ( | String[] | newStateHierarchy | ) | [inline, protected] |
Subclasses may override this and do something useful with the new state...
| newState |
Reimplemented in alma::ACS::MasterComponentImpl::MasterComponentImplBase::StateChangeNotificationChecker, and alma::ACS::MasterComponentImpl::tool::MasterComponentEventLogger::MyStateChangeListener.
References logNotification().
Referenced by working().
| boolean alma::ACS::MasterComponentImpl::StateChangeListener::verifyCurrentState | ( | String[] | expectedHierarchy | ) | [inline] |
Helper method for the repeated task of getting the current state hierarchy and comparing it against the expected hierarchy.
expectedHierarchy. References getCurrentState(), and logger.
| final void alma::ACS::MasterComponentImpl::StateChangeListener::working | ( | String[] | value, | |
| Completion | completion, | |||
| CBDescOut | desc | |||
| ) | [inline] |
Referenced by createMonitor(), and destroyMonitor().
final Logger alma::ACS::MasterComponentImpl::StateChangeListener::logger [protected] |
Referenced by alma::ACS::MasterComponentImpl::MasterComponentImplBase::StateChangeNotificationChecker::announceStateChangeNotification(), done(), logNotification(), alma::ACS::MasterComponentImpl::MasterComponentImplBase::StateChangeNotificationChecker::stateChangedNotification(), and verifyCurrentState().
Referenced by createMonitor(), and destroyMonitor().
final MyStateChangeSemaphore alma::ACS::MasterComponentImpl::StateChangeListener::stateChangeSemaphore [private] |
Referenced by getStateChangeSemaphore(), StateChangeListener(), and working().
Referenced by createMonitor(), and getCurrentState().
1.6.2