org.objectweb.proactive.core.component.body
Class ComponentActivity

java.lang.Object
  extended byorg.objectweb.proactive.core.component.body.ComponentActivity
All Implemented Interfaces:
Active, EndActive, InitActive, RunActive

public class ComponentActivity
extends java.lang.Object
implements RunActive, InitActive, EndActive

This class defines the activity of active objects that are components. It allows the definition of a non functional activity (for managing a component in a stopped state), and the encapsulation of a (possibly user-defined) functional activity that runs when the lifecycle of the component is started.

Author:
Matthieu Morel

Constructor Summary
ComponentActivity()
           
ComponentActivity(Active activity, java.lang.Object reifiedObject)
           
 
Method Summary
 void endActivity(Body body)
          Finalized the active object after the activity has been stopped.
 void initActivity(Body body)
          Initializes the activity of the active object.
 void runActivity(Body body)
           Runs the activity as defined in @see ComponentRunActive.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentActivity

public ComponentActivity()

ComponentActivity

public ComponentActivity(Active activity,
                         java.lang.Object reifiedObject)
Method Detail

runActivity

public void runActivity(Body body)

Runs the activity as defined in @see ComponentRunActive. The default behaviour is to serve non-functional requests in FIFO order, until the component is started. Then the functional activity (as defined in @see InitActive, @see RunActive and @see EndActive) begins.

When redefining the @see RunActive#runActivity(Body) method, the @see Body#isActive() returns true as long as the lifecycle of the component is @see LifeCycleController#STARTED. When the lifecycle of the component is @see LifeCycleController#STOPPED, @see Body#isActive() returns false.

Specified by:
runActivity in interface RunActive
Parameters:
body - the body of the active object being started

initActivity

public void initActivity(Body body)
Description copied from interface: InitActive
Initializes the activity of the active object.

Specified by:
initActivity in interface InitActive
Parameters:
body - the body of the active object being initialized

endActivity

public void endActivity(Body body)
Description copied from interface: EndActive
Finalized the active object after the activity has been stopped.

Specified by:
endActivity in interface EndActive
Parameters:
body - the body of the active object being finalized.


Copyright 2001-2005 INRIA All Rights Reserved.