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

java.lang.Object
  extended byorg.objectweb.dream.AbstractComponent
      extended byorg.objectweb.dream.control.activity.task.thread.AbstractThreadTask
All Implemented Interfaces:
BindingController, LifeCycleController, Loggable, Task
Direct Known Subclasses:
BasicThreadPoolTask, BasicThreadTask

public abstract class AbstractThreadTask
extends AbstractComponent
implements Task

Abstract class representing a thread task.


Field Summary
protected  Scheduler scheduler
          The scheduler to which the thread is bound.
 
Fields inherited from class org.objectweb.dream.AbstractComponent
bindingLogger, componentDesc, fcState, lifeCycleLogger, logger, weaveableC
 
Fields inherited from interface org.objectweb.dream.control.activity.task.Task
ITF_NAME
 
Fields inherited from interface org.objectweb.fractal.api.control.LifeCycleController
STARTED, STOPPED
 
Constructor Summary
AbstractThreadTask()
           
 
Method Summary
 void bindFc(String clientItfName, Object serverItf)
           
 Object execute(Object hints)
          The method that is executed.
protected abstract  boolean isExecuting()
          Called by execute(Object)method.
 String[] listFc()
           
protected abstract  void setExecuting(boolean b)
          Called by execute(Object)method.
 void unbindFc(String clientItfName)
           
 
Methods inherited from class org.objectweb.dream.AbstractComponent
getFcState, initComponent, lookupFc, setLogger, startFc, stopFc
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

scheduler

protected Scheduler scheduler
The scheduler to which the thread is bound.

Constructor Detail

AbstractThreadTask

public AbstractThreadTask()
Method Detail

isExecuting

protected abstract boolean isExecuting()
Called by execute(Object)method.

Returns:
false if the execute(Object)method must return.

setExecuting

protected abstract void setExecuting(boolean b)
Called by execute(Object)method. Sets its execution state.

Parameters:
b - false if the execute(Object)method must return.

execute

public Object execute(Object hints)
               throws InterruptedException
Description copied from interface: Task
The method that is executed.

Specified by:
execute in interface Task
Parameters:
hints - execution paramters.
Returns:
an object representing the execution result.
Throws:
InterruptedException - if this task is interrupted.
See Also:
Task.execute(Object)

bindFc

public void bindFc(String clientItfName,
                   Object serverItf)
            throws NoSuchInterfaceException,
                   IllegalBindingException,
                   IllegalLifeCycleException
Specified by:
bindFc in interface BindingController
Overrides:
bindFc in class AbstractComponent
Throws:
NoSuchInterfaceException
IllegalBindingException
IllegalLifeCycleException
See Also:
BindingController.bindFc(String, Object)

unbindFc

public void unbindFc(String clientItfName)
              throws NoSuchInterfaceException,
                     IllegalBindingException,
                     IllegalLifeCycleException
Specified by:
unbindFc in interface BindingController
Overrides:
unbindFc in class AbstractComponent
Throws:
NoSuchInterfaceException
IllegalBindingException
IllegalLifeCycleException
See Also:
BindingController.unbindFc(String)

listFc

public String[] listFc()
Specified by:
listFc in interface BindingController
See Also:
BindingController.listFc()


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