Public Member Functions | Package Functions

alma.acs.container.ComponentStateManagerImpl Class Reference

Inheritance diagram for alma.acs.container.ComponentStateManagerImpl:
alma.acs.component.ComponentStateManager

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

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 
)

Member Function Documentation

synchronized ComponentStates alma.acs.container.ComponentStateManagerImpl.getCurrentState (  ) 

Returns the current state of the component

Returns:
the component's current state

See also:
alma.acs.component.ComponentStateManager.getCurrentState()

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.

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.

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)

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

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

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().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties