aokell.lib.control.lifecycle
Class AbstractLifeCycleControllerImpl

java.lang.Object
  extended by aokell.lib.control.lifecycle.AbstractLifeCycleControllerImpl
All Implemented Interfaces:
Controller, LifeCycleControllerItf, LifeCycleController
Direct Known Subclasses:
CompositeLifeCycleControllerImpl, NonCompositeLifeCycleControllerImpl

public abstract class AbstractLifeCycleControllerImpl
extends Object
implements LifeCycleControllerItf, Controller

Root class for life cyle controller implementations.

Author:
Lionel Seinturier , Romain Rouvoy

Field Summary
protected  Component compctrl
           
protected  boolean started
           
 
Fields inherited from interface aokell.lib.control.lifecycle.LifeCycleControllerItf
NAME, TYPE
 
Fields inherited from interface org.objectweb.fractal.api.control.LifeCycleController
STARTED, STOPPED
 
Constructor Summary
AbstractLifeCycleControllerImpl()
           
 
Method Summary
 void cloneFcCtrl(Component dst, Object hints)
          Clone the controller state from the current component to another one.
 String getFcState()
           
 void initFcCtrl()
          Initialize the controller.
 boolean isFcStarted()
           
 void setFcCompCtrl(Component compctrl)
          Set the reference towards the component controller associated to this controller.
 boolean setFcStarted()
           
 boolean setFcStopped()
           
 void startFc()
           
 void stopFc()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

started

protected boolean started

compctrl

protected Component compctrl
Constructor Detail

AbstractLifeCycleControllerImpl

public AbstractLifeCycleControllerImpl()
Method Detail

getFcState

public String getFcState()
Specified by:
getFcState in interface LifeCycleController

startFc

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

stopFc

public void stopFc()
            throws IllegalLifeCycleException
Specified by:
stopFc in interface LifeCycleController
Throws:
IllegalLifeCycleException

isFcStarted

public boolean isFcStarted()
Specified by:
isFcStarted in interface LifeCycleControllerItf
Returns:
true if the component is started

setFcStarted

public boolean setFcStarted()
                     throws IllegalLifeCycleException
Specified by:
setFcStarted in interface LifeCycleControllerItf
Returns:
true if the component is in the STOPPED state before the call.
Throws:
IllegalLifeCycleException

setFcStopped

public boolean setFcStopped()
                     throws IllegalLifeCycleException
Specified by:
setFcStopped in interface LifeCycleControllerItf
Returns:
true if the component is in the STARTED state before the call.
Throws:
IllegalLifeCycleException

setFcCompCtrl

public void setFcCompCtrl(Component compctrl)
Set the reference towards the component controller associated to this controller.

Specified by:
setFcCompCtrl in interface Controller

initFcCtrl

public void initFcCtrl()
Initialize the controller.

Specified by:
initFcCtrl in interface Controller

cloneFcCtrl

public void cloneFcCtrl(Component dst,
                        Object hints)
                 throws CloneCtrlException
Clone the controller state from the current component to another one. This method may receive some hints on how to do this, or provide some hints on how this has been done. For instance, the hints may be a map that is read and/or written by the controller. The raison d'etre of these hints is that when its state is cloned, a controller may produce results that are needed by other controllers. For instance the content controller creates new instances, and put in the hints a map associating old instances and their newly created conterparts.

Specified by:
cloneFcCtrl in interface Controller
Parameters:
dst - the destination component
hints - hints for performing the operation
Throws:
CloneCtrlException