org.objectweb.fractal.julia.control.lifecycle
Class BasicLifeCycleCoordinatorMixin

java.lang.Object
  extended by org.objectweb.fractal.julia.control.lifecycle.BasicLifeCycleCoordinatorMixin
All Implemented Interfaces:
LifeCycleController, LifeCycleCoordinator

public abstract class BasicLifeCycleCoordinatorMixin
extends Object
implements LifeCycleCoordinator

Provides an abstract implementation of the LifeCycleCoordinator interface.

Requirements


Field Summary
 Component _this_weaveableC
          The weaveableC field required by this mixin.
 List fcActive
          The components that are currently active.
 
Fields inherited from interface org.objectweb.fractal.api.control.LifeCycleController
STARTED, STOPPED
 
Method Summary
 boolean fcActivated(LifeCycleCoordinator component)
          Notifies this component that the given component is about to become active.
 void fcInactivated(LifeCycleCoordinator component)
          Notifies this component that the given component has become inactive.
 void setFcState(boolean started)
          Sets the lifecycle state of this component and of all its direct and indirect sub components that have a LifeCycleCoordinator interface.
 void stopFc(LifeCycleCoordinator[] components)
          Stops the given components simultaneously.
 
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
setFcStarted, setFcStopped, setFcStopping
 
Methods inherited from interface org.objectweb.fractal.api.control.LifeCycleController
getFcState, startFc, stopFc
 

Field Detail

fcActive

public List fcActive
The components that are currently active.


_this_weaveableC

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

Method Detail

setFcState

public void setFcState(boolean started)
                throws IllegalLifeCycleException
Sets the lifecycle state of this component and of all its direct and indirect sub components that have a LifeCycleCoordinator interface.

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.

fcActivated

public boolean fcActivated(LifeCycleCoordinator component)
Description copied from interface: LifeCycleCoordinator
Notifies this component that the given component is about to become active. This method must be called by a component when the following conditions are met:

Specified by:
fcActivated in interface LifeCycleCoordinator
Parameters:
component - the LifeCycleCoordinator interface of a component that is about to become active.
Returns:
true if the given component can become active, or false if the new activity must be delayed until the component is restarted.

fcInactivated

public void fcInactivated(LifeCycleCoordinator component)
Description copied from interface: LifeCycleCoordinator
Notifies this component that the given component has become inactive. This method must be called by a component when the following conditions are met:

Specified by:
fcInactivated in interface LifeCycleCoordinator
Parameters:
component - the LifeCycleCoordinator interface of a component that has become inactive.

stopFc

public void stopFc(LifeCycleCoordinator[] components)
            throws IllegalLifeCycleException
Stops the given components simultaneously. This method sets the state of the components to "STOPPING", waits until all the components are simultaneoulsy inactive (their state is known thanks to the fcActivated and fcInactivated callback methods), and then sets the state of the components to STOPPED.

Parameters:
components - the LifeCycleCoordinator interface of the components to be stopped.
Throws:
IllegalLifeCycleException - if a problem occurs.