org.objectweb.fractal.api.control
Interface LifeCycleController


public interface LifeCycleController

A component interface to control the lifecycle of the component to which it belongs. The lifecycle of a component is supposed to be an automaton, whose states represent execution states of the component. This interface corresponds to an automaton with two states called STARTED and STOPPED, where all the 4 four possible transitions are allowed. It is however possible to define completely different lifecycle controller Java interfaces to use completely different automatons, or to define sub interfaces of this interface to define automatons based on this one, but with more states and more transitions.

Note: the sub-interfaces of this interface should use the conventions used in this interface, which are the following. The interface contains one method per state in the lifecycle automaton. Each of these methods changes the current state to the state corresponding to its name, if there is a transition from the current state to this state. The interface also contains one field per state. The names and values of these fields correspond to the names of the methods.


Field Summary
static java.lang.String STARTED
          The state of a component just after startFc has been executed.
static java.lang.String STOPPED
          The state of a component just after stopFc has been executed.
 
Method Summary
 java.lang.String getFcState()
          Returns the execution state of the component to which this interface belongs.
 void startFc()
          Starts the component to which this interface belongs.
 void stopFc()
          Stops the component to which this interface belongs.
 

Field Detail

STARTED

static final java.lang.String STARTED
The state of a component just after startFc has been executed.

See Also:
Constant Field Values

STOPPED

static final java.lang.String STOPPED
The state of a component just after stopFc has been executed. This state is also the initial state of a component, i.e., the state of a component just after it has been created.

See Also:
Constant Field Values
Method Detail

getFcState

java.lang.String getFcState()
Returns the execution state of the component to which this interface belongs.

Returns:
the execution state of the component to which this interface belongs.

startFc

void startFc()
             throws IllegalLifeCycleException
Starts the component to which this interface belongs.

Throws:
IllegalLifeCycleException - if the transition from the current state to the STARTED state is not a valid transition of the life cycle automaton.

stopFc

void stopFc()
            throws IllegalLifeCycleException
Stops the component to which this interface belongs. The result of a method call on a stopped component is undefined, except on its control interfaces (these calls are executed normally).

Throws:
IllegalLifeCycleException - if the transition from the current state to the STOPPED state is not a valid transition of the life cycle automaton.


Copyright © 2007-2011. All Rights Reserved.