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.
static String | STARTED - The state of a component just after
startFc has been
executed.
|
static String | STOPPED - The state of a component just after
stopFc has been
executed.
|
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.
|
STARTED
public static final String STARTED
The state of a component just after
startFc
has been
executed.
STOPPED
public static final 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.
getFcState
public String getFcState()
Returns the execution state of the component to which this interface
belongs.
- the execution state of the component to which this interface
belongs.
stopFc
public 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).
IllegalLifeCycleException
- if the transition from the current state
to the STOPPED
state is not a valid transition of the
life cycle automaton.