org.objectweb.dream.control.activity.task.thread
Class ThreadTask

java.lang.Object
  extended byorg.objectweb.dream.AbstractComponent
      extended byorg.objectweb.dream.control.activity.task.thread.AbstractThreadTask
          extended byorg.objectweb.dream.control.activity.task.thread.ThreadTask
All Implemented Interfaces:
BindingController, LifeCycleController, Loggable, Runnable, Task, TaskLifeCycleController

public class ThreadTask
extends AbstractThreadTask
implements Runnable, TaskLifeCycleController

Basic implementation of a Dream thread.

See Also:
AbstractThreadTask

Field Summary
protected  boolean executing
           
protected  List taskStoppedListeners
           
protected  Thread thread
           
protected  Object threadTaskLock
           
 
Fields inherited from class org.objectweb.dream.control.activity.task.thread.AbstractThreadTask
scheduler
 
Fields inherited from class org.objectweb.dream.AbstractComponent
bindingLogger, componentDesc, fcState, firstStart, lifeCycleLogger, logger, weaveableC
 
Fields inherited from interface org.objectweb.fractal.api.control.LifeCycleController
STARTED, STOPPED
 
Fields inherited from interface org.objectweb.dream.control.activity.task.Task
ITF_NAME
 
Constructor Summary
ThreadTask()
           
 
Method Summary
 void asyncStop(TaskStoppedListener listener)
          Stops asynchronously the task, this interface belong.
protected  boolean isExecuting()
          Called by AbstractThreadTask.execute(Object)method.
 void run()
           
protected  void setExecuting(boolean b)
          Called by AbstractThreadTask.execute(Object)method.
 void startFc()
           
 void stopFc()
           
 
Methods inherited from class org.objectweb.dream.control.activity.task.thread.AbstractThreadTask
bindFc, execute, listFc, unbindFc
 
Methods inherited from class org.objectweb.dream.AbstractComponent
beforeFirstStart, getFcState, initComponent, lookupFc, setLogger
 
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.api.control.LifeCycleController
getFcState
 

Field Detail

threadTaskLock

protected Object threadTaskLock

thread

protected Thread thread

taskStoppedListeners

protected List taskStoppedListeners

executing

protected boolean executing
Constructor Detail

ThreadTask

public ThreadTask()
Method Detail

isExecuting

protected boolean isExecuting()
Description copied from class: AbstractThreadTask
Called by AbstractThreadTask.execute(Object)method.

Specified by:
isExecuting in class AbstractThreadTask
Returns:
false if the AbstractThreadTask.execute(Object)method must return.
See Also:
AbstractThreadTask.isExecuting()

setExecuting

protected void setExecuting(boolean b)
Description copied from class: AbstractThreadTask
Called by AbstractThreadTask.execute(Object)method. Sets its execution state.

Specified by:
setExecuting in class AbstractThreadTask
Parameters:
b - false if the AbstractThreadTask.execute(Object)method must return.
See Also:
AbstractThreadTask.setExecuting(boolean)

run

public void run()
Specified by:
run in interface Runnable
See Also:
Runnable.run()

startFc

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

stopFc

public void stopFc()
            throws IllegalLifeCycleException
Specified by:
stopFc in interface LifeCycleController
Overrides:
stopFc in class AbstractComponent
Throws:
IllegalLifeCycleException
See Also:
LifeCycleController.stopFc()

asyncStop

public void asyncStop(TaskStoppedListener listener)
Description copied from interface: TaskLifeCycleController
Stops asynchronously the task, this interface belong. This method returns immediatly. The given listener will be notified when the task has stopped. If the task is already in the LifeCycleController.STOPPEDstate, the listener is immediatly notified.

Specified by:
asyncStop in interface TaskLifeCycleController
Parameters:
listener - listener nitified when the task has stopped.
See Also:
TaskLifeCycleController.asyncStop(TaskStoppedListener)


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