org.objectweb.dream.control.activity.task
Interface Task

All Known Implementing Classes:
AbstractTask, AbstractThreadTaskImpl, ThreadTaskImpl

public interface Task

Interface representing a task.


Field Summary
static Integer EXECUTE_AGAIN
          An integer that can be used with some schedulers to specify that the task should be executed again.
static String ITF_NAME
          The commonly used nam to refer to this interface.
static Integer STOP_EXECUTING
          An integer that can be used with some schedulers to specify that the task should not be executed again.
 
Method Summary
 Object execute(Object hints)
          The method that is executed.
 void interrupted()
          Call back method used by scheduler to notify a task that has been interrupted.
 void registered(Object controlItf)
          Call back method to notify that the task as been correctly registered in the task manager.
 void unregistered()
          Call back method to notify that the task has been unregistered from the activity manager.
 

Field Detail

ITF_NAME

static final String ITF_NAME
The commonly used nam to refer to this interface.

See Also:
Constant Field Values

EXECUTE_AGAIN

static final Integer EXECUTE_AGAIN
An integer that can be used with some schedulers to specify that the task should be executed again.


STOP_EXECUTING

static final Integer STOP_EXECUTING
An integer that can be used with some schedulers to specify that the task should not be executed again.

Method Detail

execute

Object execute(Object hints)
               throws InterruptedException
The method that is executed.

Parameters:
hints - execution paramters.
Returns:
an object representing the execution result.
Throws:
InterruptedException - if this task is interrupted.

interrupted

void interrupted()
Call back method used by scheduler to notify a task that has been interrupted. Task implementation may override this method to free resources and ensure that the task execution will end.


registered

void registered(Object controlItf)
Call back method to notify that the task as been correctly registered in the task manager.

Parameters:
controlItf - An interface that can be used to control the execution of the task. The runtime type of this interface depends on the registration hints. Can be null.

unregistered

void unregistered()
Call back method to notify that the task has been unregistered from the activity manager.



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