Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

alma::ACS::MasterComponentImpl::StateChangeListener Class Reference

Inheritance diagram for alma::ACS::MasterComponentImpl::StateChangeListener:

Inheritance graph
[legend]
Collaboration diagram for alma::ACS::MasterComponentImpl::StateChangeListener:

Collaboration graph
[legend]
List of all members.

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

Detailed Description

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[])).

Author:
hsommer created Apr 30, 2004 11:08:27 AM


Constructor & Destructor Documentation

alma::ACS::MasterComponentImpl::StateChangeListener::StateChangeListener Logger  logger  )  [inline]
 


Member Function Documentation

MonitorstringSeq alma::ACS::MasterComponentImpl::StateChangeListener::createMonitor ROstringSeq  statesProperty,
ContainerServices  contSrv
throws Exception [inline]
 

Creates a monitor for statesProperty from this instance.

Parameters:
statesProperty 
contSrv 
Returns:
usually not needed
Exceptions:
Exception 

void alma::ACS::MasterComponentImpl::StateChangeListener::destroyMonitor  )  throws Exception [inline]
 

Exceptions:
Exception 

void alma::ACS::MasterComponentImpl::StateChangeListener::done String[]  value,
Completion  completion,
CBDescOut  desc
[inline]
 

See also:
alma.ACS.CBstringSeqOperations::done(java.lang.String[], alma.ACSErr.Completion, alma.ACS.CBDescOut)

String [] alma::ACS::MasterComponentImpl::StateChangeListener::getCurrentState  )  throws AcsJIllegalStateEventEx [inline]
 

Reads the current state hierarchy.

Returns:
State hierarchy with outmost state first
Exceptions:
AcsJIllegalStateEventEx if the state can't be read ; : use better fitting ex (don't want to create one now right before the release)

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.

void alma::ACS::MasterComponentImpl::StateChangeListener::logNotification String[]  value,
Completion  completion
[inline, protected]
 

Logs a state change notification.

Parameters:
value the new state hierarchy
completion an optional completion

boolean alma::ACS::MasterComponentImpl::StateChangeListener::negotiate long  timeout,
CBDescOut  desc
[inline]
 

See also:
alma.ACS.CallbackOperations::negotiate(long, alma.ACS.CBDescOut)

void alma::ACS::MasterComponentImpl::StateChangeListener::stateChangedNotification String[]  newStateHierarchy  )  [inline, protected]
 

Subclasses may override this and do something useful with the new state...

Parameters:
newState 

Reimplemented in alma::ACS::MasterComponentImpl::MasterComponentImplBase::StateChangeNotificationChecker, and alma::ACS::MasterComponentImpl::tool::MasterComponentEventLogger::MyStateChangeListener.

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.

Returns:
true if the current state hierarchy is equal to expectedHierarchy.

final void alma::ACS::MasterComponentImpl::StateChangeListener::working String[]  value,
Completion  completion,
CBDescOut  desc
[inline]
 

See also:
alma.ACS.CBstringSeqOperations::working(java.lang.String[], alma.ACSErr.Completion, alma.ACS.CBDescOut)


Member Data Documentation

ContainerServices alma::ACS::MasterComponentImpl::StateChangeListener::contSrv [private]
 

final Logger alma::ACS::MasterComponentImpl::StateChangeListener::logger [protected]
 

MonitorstringSeq alma::ACS::MasterComponentImpl::StateChangeListener::monitor [private]
 

final MyStateChangeSemaphore alma::ACS::MasterComponentImpl::StateChangeListener::stateChangeSemaphore [private]
 

ROstringSeq alma::ACS::MasterComponentImpl::StateChangeListener::statesProperty [private]
 


The documentation for this class was generated from the following file:
Generated on Thu Apr 30 02:54:03 2009 for ACS Java API by doxygen 1.3.8