org.objectweb.dream.control.lifecycle
Class SimpleLifeCycleControllerMixin

java.lang.Object
  extended byorg.objectweb.dream.control.lifecycle.SimpleLifeCycleControllerMixin
All Implemented Interfaces:
LifeCycleController, LifeCycleCoordinator

public abstract class SimpleLifeCycleControllerMixin
extends Object
implements LifeCycleCoordinator

Basic Dream life cycle controller. Component with this simple lifecycle implementation can't be stopped alone (ie :stopFc()throws a IllegalLifeCycleExceptionis the component is not already in the stop state.

Requirements


Field Summary
 Component _this_weaveableC
          The weaveableC field required by this mixin.
 Logger _this_weaveableLCCLogger
          The weaveableLCCLogger field required by this mixin.
 int weaveableFcState
          The lifecycle state of the component.
 
Fields inherited from interface org.objectweb.fractal.api.control.LifeCycleController
STARTED, STOPPED
 
Constructor Summary
SimpleLifeCycleControllerMixin()
           
 
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.
 boolean checkInactivity()
          Returns true if the component is inactive.
 LifeCycleCoordinator getFcCoordinator()
          Returns the LifeCycleCoordinatorinterface of this component.
 String getFcState()
           
 void initFcController(InitializationContext ic)
           
 boolean isInactivated(LifeCycleCoordinator coordinator)
          If checkInactivity()returns true, calls LifeCycleCoordinator.fcInactivated(org.objectweb.fractal.julia.control.lifecycle.LifeCycleCoordinator)with the given coordinator and returns true.
 boolean setFcStarted()
           
 boolean setFcStopped()
           
 void setFcStopping(LifeCycleCoordinator coordinator)
          Calls immediatly LifeCycleCoordinator.fcInactivated(org.objectweb.fractal.julia.control.lifecycle.LifeCycleCoordinator).
 void startFc()
           
 void stopFc()
          Throws a IllegalLifeCycleExceptionif the component is in the LifeCycleController.STARTED state.
 
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

weaveableFcState

public int weaveableFcState
The lifecycle state of the component. Zero means stopped, one means stopping and two means started.


_this_weaveableC

public Component _this_weaveableC
The weaveableC field required by this mixin. This field is supposed to reference the Componentinterface of the component to which this controller object belongs.


_this_weaveableLCCLogger

public Logger _this_weaveableLCCLogger
The weaveableLCCLogger field required by this mixin. This field is supposed to reference the Loggerof this controller.

Constructor Detail

SimpleLifeCycleControllerMixin

public SimpleLifeCycleControllerMixin()
Method Detail

initFcController

public void initFcController(InitializationContext ic)
                      throws InstantiationException
Throws:
InstantiationException
See Also:
Controller.initFcController(InitializationContext)

getFcState

public String getFcState()
Specified by:
getFcState in interface LifeCycleController
See Also:
LifeCycleController.getFcState()

startFc

public void startFc()
             throws IllegalLifeCycleException
Specified by:
startFc in interface LifeCycleController
Throws:
IllegalLifeCycleException
See Also:
LifeCycleController.startFc()

stopFc

public void stopFc()
            throws IllegalLifeCycleException
Throws a IllegalLifeCycleExceptionif the component is in the LifeCycleController.STARTED state.

Specified by:
stopFc in interface LifeCycleController
Throws:
IllegalLifeCycleException
See Also:
LifeCycleController.stopFc()

setFcStarted

public boolean setFcStarted()
                     throws IllegalLifeCycleException
Specified by:
setFcStarted in interface LifeCycleCoordinator
Throws:
IllegalLifeCycleException
See Also:
LifeCycleCoordinator.setFcStarted()

setFcStopping

public void setFcStopping(LifeCycleCoordinator coordinator)
                   throws IllegalLifeCycleException
Calls immediatly LifeCycleCoordinator.fcInactivated(org.objectweb.fractal.julia.control.lifecycle.LifeCycleCoordinator).

Specified by:
setFcStopping in interface LifeCycleCoordinator
Throws:
IllegalLifeCycleException
See Also:
LifeCycleCoordinator.setFcStopping(LifeCycleCoordinator)

setFcStopped

public boolean setFcStopped()
                     throws IllegalLifeCycleException
Specified by:
setFcStopped in interface LifeCycleCoordinator
Throws:
IllegalLifeCycleException
See Also:
LifeCycleCoordinator.setFcStopped()

checkInactivity

public boolean checkInactivity()
Returns true if the component is inactive. This implementation always returns true. Other mixins can ovverride this method.

Returns:
true if the component is inactive.

isInactivated

public boolean isInactivated(LifeCycleCoordinator coordinator)
If checkInactivity()returns true, calls LifeCycleCoordinator.fcInactivated(org.objectweb.fractal.julia.control.lifecycle.LifeCycleCoordinator)with the given coordinator and returns true.

Parameters:
coordinator - the coordinator passed to LifeCycleCoordinator.fcInactivated(org.objectweb.fractal.julia.control.lifecycle.LifeCycleCoordinator)
Returns:
the value of checkInactivity()

getFcCoordinator

public LifeCycleCoordinator getFcCoordinator()
Returns the LifeCycleCoordinatorinterface of this component.

Returns:
the LifeCycleCoordinatorinterface of the component to which this controller object belongs.

_this_setFcState

public abstract void _this_setFcState(boolean started)
                               throws IllegalLifeCycleException
The setFcState method required by this mixin. This method is supposed to work as this setFcState method.

Parameters:
started - true to set the lifecycle state of the components to STARTED, or false to set this state to STOPPED.
Throws:
IllegalLifeCycleException - if a problem occurs.

_super_initFcController

public abstract void _super_initFcController(InitializationContext ic)
                                      throws InstantiationException
The initFcController method overriden by this mixin.

Parameters:
ic - information about the component to which this controller object belongs.
Throws:
InstantiationException - if the initialization fails.


Copyright © 2003, 2004 - INRIA Rhone-Alpes - All Rights Reserved.