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.

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

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]

References stateChangeSemaphore.


Member Function Documentation

MonitorstringSeq alma::ACS::MasterComponentImpl::StateChangeListener::createMonitor ( ROstringSeq  statesProperty,
ContainerServices  contSrv 
) throws Exception [inline]
void alma::ACS::MasterComponentImpl::StateChangeListener::destroyMonitor (  )  throws Exception [inline]
void alma::ACS::MasterComponentImpl::StateChangeListener::done ( String[]  value,
Completion  completion,
CBDescOut  desc 
) [inline]
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)

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.

Parameters:
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...

Parameters:
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.

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

References getCurrentState(), and logger.

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

Member Data Documentation

Referenced by createMonitor(), and destroyMonitor().

Referenced by createMonitor(), and destroyMonitor().

Referenced by createMonitor(), and getCurrentState().


The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2