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 |
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 | |||
) |
synchronized ComponentStates alma.acs.container.ComponentStateManagerImpl.getCurrentState | ( | ) |
Returns the current state of the component
Implements alma.acs.component.ComponentStateManager.
Referenced by alma.acs.container.ComponentStateManagerImpl.setState().
String alma.acs.container.ComponentStateManagerImpl.getName | ( | ComponentStates | corbaStateObj | ) |
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.
Referenced by alma.acs.container.ComponentStateManagerImpl.setState().
synchronized void alma.acs.container.ComponentStateManagerImpl.setState | ( | ComponentStates | newState | ) | throws ComponentLifecycleException |
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 alma.acs.container.ComponentStateManagerImpl.getCurrentState(), and alma.acs.container.ComponentStateManagerImpl.getName().
Referenced by alma.acs.container.ComponentStateManagerImpl.setStateByContainer().
synchronized void alma.acs.container.ComponentStateManagerImpl.setStateByContainer | ( | ComponentStates | newState | ) | throws ComponentLifecycleException [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 alma.acs.container.ComponentStateManagerImpl.setState().
Referenced by alma.acs.container.ComponentAdapter.deactivateComponent(), alma.acs.container.ComponentAdapter.executeComponent(), alma.acs.container.ComponentAdapter.getComponentAbortionist(), and alma.acs.container.ComponentAdapter.initializeComponent().