|
|||||||||||
| 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 ic)
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()
|
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()
|
void |
stopFc()
|
| 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 Controlleric - information about the component to which this controller object
belongs.
InstantiationException - if the initialization fails.public String getFcState()
getFcState in interface LifeCycleController
public void startFc()
throws IllegalLifeCycleException
startFc in interface LifeCycleControllerIllegalLifeCycleException
public void stopFc()
throws IllegalLifeCycleException
stopFc in interface LifeCycleControllerIllegalLifeCycleException
public boolean setFcStarted()
throws IllegalLifeCycleException
LifeCycleCoordinatorSTARTED. 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 LifeCycleCoordinatorSTARTED value.
IllegalLifeCycleException - if a problem occurs.
public void setFcStopping(LifeCycleCoordinator coordinator)
throws IllegalLifeCycleException
LifeCycleCoordinatorsetFcStopped 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 LifeCycleCoordinatorcoordinator - 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
LifeCycleCoordinatorSTOPPED. 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 LifeCycleCoordinatorSTOPPED 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.
started - true to set the lifecycle state of the components
to STARTED, or false to set this state to
STOPPED.
IllegalLifeCycleException - if a problem occurs.
public abstract void _this_stopFc(LifeCycleCoordinator[] components)
throws IllegalLifeCycleException
stopFc method.
components - the LifeCycleCoordinator interface of the
components to be stopped.
IllegalLifeCycleException - if a problem occurs.
public abstract void _super_initFcController(InitializationContext ic)
throws InstantiationException
initFcController method overriden
by this mixin.
ic - information about the component to which this controller object
belongs.
InstantiationException - if the initialization fails.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||