

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 |
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.
| alma::acs::container::ComponentStateManagerImpl::ComponentStateManagerImpl | ( | String | componentName, | |
| Logger | logger | |||
| ) | [inline] |
References alma::ACS::ComponentStates::COMPSTATE_NEW, m_componentName, m_currentState, and m_logger.
| synchronized ComponentStates alma::acs::container::ComponentStateManagerImpl::getCurrentState | ( | ) | [inline] |
Returns the current state of the component
Implements alma::acs::component::ComponentStateManager.
References m_currentState.
Referenced by alma::acs::container::AcsContainer::abortAllComponents(), alma::acs::container::AcsContainer::markAndFilterForDeactivation(), and setState().
| 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.
| corbaStateObj | the int-based corba enum class |
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)
| newState | the new component state |
| ComponentLifecycleException | if the transition from the current state to the new state is not allowed. |
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.
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().
String alma::acs::container::ComponentStateManagerImpl::m_componentName [private] |
Referenced by ComponentStateManagerImpl(), and setState().
Referenced by ComponentStateManagerImpl(), getCurrentState(), and setState().
Logger alma::acs::container::ComponentStateManagerImpl::m_logger [private] |
Referenced by ComponentStateManagerImpl(), getName(), and setState().
1.6.2