alma::acs::container::ComponentStateManagerImpl Class Reference

Inheritance diagram for alma::acs::container::ComponentStateManagerImpl:
Inheritance graph
[legend]
Collaboration diagram for alma::acs::container::ComponentStateManagerImpl:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ComponentStateManagerImpl (String componentName, Logger logger)
synchronized ComponentStates getCurrentState ()
String getName (ComponentStates corbaStateObj)
synchronized void setState (ComponentStates newState) throws ComponentLifecycleException

Package Functions

synchronized void setStateByContainer (ComponentStates newState) throws ComponentLifecycleException

Private Attributes

ComponentStates m_currentState
Logger m_logger
String m_componentName

Detailed Description

Manages the state of a component, enforcing state transition rules. An instance of ComponentStateManager is logically part of the container, but the component can access it and request a state change.

Author:
hsommer created Oct 22, 2003 5:03:07 PM

Constructor & Destructor Documentation

alma::acs::container::ComponentStateManagerImpl::ComponentStateManagerImpl ( String  componentName,
Logger  logger 
) [inline]

Member Function Documentation

synchronized ComponentStates alma::acs::container::ComponentStateManagerImpl::getCurrentState (  )  [inline]
String alma::acs::container::ComponentStateManagerImpl::getName ( ComponentStates  corbaStateObj  )  [inline]

It seemed not worth it to create Java enum classes following the standard patterns, since the component has to return the CORBA state class anyway. Nonetheless, getting the state names for logging etc. might be useful.

Parameters:
corbaStateObj the int-based corba enum class
Returns:
the state name as specified in IDL, e.g. "COMPSTATE_NEW".

See also:
alma.acs.component.ComponentStateManager::getName(alma.ACS.ComponentStates)

Implements alma::acs::component::ComponentStateManager.

References m_logger, and alma::ACS::ComponentStates::value.

Referenced by setState().

synchronized void alma::acs::container::ComponentStateManagerImpl::setState ( ComponentStates  newState  )  throws ComponentLifecycleException [inline]

Requests to change the state. To be called only by the component (the container will use a separate method in the implementation class to allow for different transition validation rules)

Parameters:
newState the new component state
Exceptions:
ComponentLifecycleException if the transition from the current state to the new state is not allowed.

See also:
alma.acs.component.ComponentStateManager::setState(alma.ACS.ComponentStates)

Implements alma::acs::component::ComponentStateManager.

References getCurrentState(), getName(), m_componentName, m_currentState, and m_logger.

Referenced by setStateByContainer().

synchronized void alma::acs::container::ComponentStateManagerImpl::setStateByContainer ( ComponentStates  newState  )  throws ComponentLifecycleException [inline, package]

To be called by the container only (it's not part of the interface).

TODO: figure out state transition rules. Perhaps allow the currently discussed set of rules only in this method, and restrict component-initiated transitions (through method setState) to those involving the ERROR state.

See also:
alma.acs.component.ComponentStateManager::setState(alma.ACS.ComponentStates)

References setState().

Referenced by alma::acs::container::ComponentAdapter::deactivateComponent(), alma::acs::container::ComponentAdapter::executeComponent(), alma::acs::container::ComponentAdapter::getComponentAbortionist(), alma::acs::container::ComponentAdapter::initializeComponent(), and alma::acs::container::AcsContainer::markAndFilterForDeactivation().


Member Data Documentation


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

Generated by  doxygen 1.6.2