Inherits alma::ACS::CBstringSeqPOA.
Inherited by alma.ACS.MasterComponentImpl.MasterComponentImplBase.StateChangeNotificationChecker, and alma.ACS.MasterComponentImpl.tool.MasterComponentEventLogger.MyStateChangeListener.
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 |
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 | ) |
MonitorstringSeq alma.ACS.MasterComponentImpl.StateChangeListener.createMonitor | ( | ROstringSeq | statesProperty, | |
ContainerServices | contSrv | |||
) | throws Exception |
Creates a monitor for statesProperty
from this instance.
statesProperty | ||
contSrv |
Exception |
References alma.acs.container.ContainerServices.activateOffShoot(), and alma.ACS.MasterComponentImpl.StateChangeListener.destroyMonitor().
void alma.ACS.MasterComponentImpl.StateChangeListener.destroyMonitor | ( | ) | throws Exception |
Exception |
References alma.acs.container.ContainerServicesBase.deactivateOffShoot().
Referenced by alma.ACS.MasterComponentImpl.StateChangeListener.createMonitor().
void alma.ACS.MasterComponentImpl.StateChangeListener.done | ( | String[] | value, | |
Completion | completion, | |||
CBDescOut | desc | |||
) |
References alma.ACS.MasterComponentImpl.StateChangeListener.logger.
String [] alma.ACS.MasterComponentImpl.StateChangeListener.getCurrentState | ( | ) | throws AcsJIllegalStateEventEx |
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.exceptions.AcsJCompletion.getCode(), alma.acs.exceptions.AcsJCompletion.getType(), and alma.acs.exceptions.AcsJCompletion.isError().
Referenced by alma.ACS.MasterComponentImpl.StateChangeListener.verifyCurrentState().
StateChangeSemaphore alma.ACS.MasterComponentImpl.StateChangeListener.getStateChangeSemaphore | ( | ) |
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.
void alma.ACS.MasterComponentImpl.StateChangeListener.logNotification | ( | String[] | value, | |
Completion | completion | |||
) | [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(), alma.ACS.MasterComponentImpl.StateChangeListener.logger, and alma.acs.exceptions.AcsJException.toString().
Referenced by alma.ACS.MasterComponentImpl.StateChangeListener.stateChangedNotification().
boolean alma.ACS.MasterComponentImpl.StateChangeListener.negotiate | ( | long | timeout, | |
CBDescOut | desc | |||
) |
void alma.ACS.MasterComponentImpl.StateChangeListener.stateChangedNotification | ( | String[] | newStateHierarchy | ) | [protected] |
Subclasses may override this and do something useful with the new state...
newState |
References alma.ACS.MasterComponentImpl.StateChangeListener.logNotification().
Referenced by alma.ACS.MasterComponentImpl.StateChangeListener.working().
boolean alma.ACS.MasterComponentImpl.StateChangeListener.verifyCurrentState | ( | String[] | expectedHierarchy | ) |
Helper method for the repeated task of getting the current state hierarchy and comparing it against the expected hierarchy.
expectedHierarchy
. References alma.ACS.MasterComponentImpl.StateChangeListener.getCurrentState(), and alma.ACS.MasterComponentImpl.StateChangeListener.logger.
final void alma.ACS.MasterComponentImpl.StateChangeListener.working | ( | String[] | value, | |
Completion | completion, | |||
CBDescOut | desc | |||
) |
References alma.ACS.MasterComponentImpl.StateChangeListener.stateChangedNotification().
final Logger alma.ACS.MasterComponentImpl.StateChangeListener.logger [protected] |