|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.fractal.julia.control.lifecycle.BasicLifeCycleControllerMixin
Provides a basic implementation of the LifeCycleController
interface.
This implementation is based on a counter managed by interceptors. This
controller needs associated interceptor objects, such as those generated by
the InterceptorClassGenerator
with a
LifeCycleCodeGenerator
, in order to
work properly (these interceptors are only needed on external server
interfaces).
Requirements
Component
interface and the LifeCycleCoordinator
interface.
Field Summary | |
Component |
_this_weaveableC
The weaveableC field required by this mixin. |
LifeCycleCoordinator |
fcCoordinator
The coordinator used to stop this component with other components simultaneously. |
int |
fcInvocationCounter
The number of currently executing method calls in this component. |
int |
fcState
The life cycle state of this component. |
Fields inherited from interface org.objectweb.fractal.api.control.LifeCycleController |
STARTED, STOPPED |
Method Summary | |
abstract void |
_super_initFcController(InitializationContext i)
The initFcController method overriden
by this mixin. |
abstract void |
_this_setFcState(boolean started)
The setFcState method required by this mixin. |
abstract void |
_this_stopFc(LifeCycleCoordinator[] components)
The stopFc method required by this mixin. |
void |
decrementFcInvocationCounter()
Decrements the number of currently executing method calls in this component. |
LifeCycleCoordinator |
getFcCoordinator()
Returns the LifeCycleCoordinator interface of this component. |
String |
getFcState()
Returns the execution state of the component to which this interface belongs. |
void |
incrementFcInvocationCounter()
Increments the number of currently executing method calls in this component. |
void |
initFcController(InitializationContext ic)
Initializes the fields of this mixin and then calls the overriden method. |
boolean |
setFcStarted()
Sets the state of this component, but not of its sub components, to STARTED . |
boolean |
setFcStopped()
Sets the state of this component, but not of its sub components, to STOPPED . |
void |
setFcStopping(LifeCycleCoordinator coordinator)
Sets the state of this component, but not of its sub components, to "STOPPING". |
void |
startFc()
Starts the component to which this interface belongs. |
void |
stopFc()
Stops the component to which this interface belongs. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.objectweb.fractal.julia.control.lifecycle.LifeCycleCoordinator |
fcActivated, fcInactivated |
Field Detail |
public int fcState
public int fcInvocationCounter
public LifeCycleCoordinator fcCoordinator
public Component _this_weaveableC
Component
interface of the component to
which this controller object belongs.
Method Detail |
public void initFcController(InitializationContext ic) throws InstantiationException
initFcController
in interface Controller
ic
- information about the component to which this controller object
belongs.
InstantiationException
- if the initialization fails.public String getFcState()
LifeCycleController
getFcState
in interface LifeCycleController
public void startFc() throws IllegalLifeCycleException
LifeCycleController
startFc
in interface LifeCycleController
IllegalLifeCycleException
- if the transition from the current state
to the STARTED
state is not a valid transition of the
life cycle automaton.public void stopFc() throws IllegalLifeCycleException
LifeCycleController
stopFc
in interface LifeCycleController
IllegalLifeCycleException
- if the transition from the current state
to the STOPPED
state is not a valid transition of the
life cycle automaton.public boolean setFcStarted() throws IllegalLifeCycleException
LifeCycleCoordinator
STARTED
. Because of component sharing, the startFc
method cannot be implemented by just calling
itself recursively on the sub components of this componets (otherwise some
sub components may be started several times). Hence this method.
setFcStarted
in interface LifeCycleCoordinator
STARTED
value.
IllegalLifeCycleException
- if a problem occurs.public void setFcStopping(LifeCycleCoordinator coordinator) throws IllegalLifeCycleException
LifeCycleCoordinator
setFcStopped
has not been called, this component must
notify the given coordinator when it becomes inactive, and when it is about
to become active, with the fcInactivated
and fcActivated
methods.
getFcState
method should return STARTED
, as the component
is not yet stopped.
setFcStopping
in interface LifeCycleCoordinator
coordinator
- the coordinator that must be notified when this
component becomes inactive, and when it is about to become active.
IllegalLifeCycleException
- if a problem occurs.public boolean setFcStopped() throws IllegalLifeCycleException
LifeCycleCoordinator
STOPPED
. Because of component sharing, the stopFc
method cannot be implemented by just calling
itself recursively on the sub components of this componets (otherwise some
sub components may be stopped several times). Hence this method.
setFcStopped
in interface LifeCycleCoordinator
STOPPED
value.
IllegalLifeCycleException
- if a problem occurs.public void incrementFcInvocationCounter()
public void decrementFcInvocationCounter()
public LifeCycleCoordinator getFcCoordinator()
LifeCycleCoordinator
interface of this component.
LifeCycleCoordinator
interface of the component to
which this controller object belongs.public abstract void _this_setFcState(boolean started) throws IllegalLifeCycleException
setFcState
method.
IllegalLifeCycleException
public abstract void _this_stopFc(LifeCycleCoordinator[] components) throws IllegalLifeCycleException
stopFc
method.
IllegalLifeCycleException
public abstract void _super_initFcController(InitializationContext i) throws InstantiationException
initFcController
method overriden
by this mixin.
InstantiationException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |