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

All Known Implementing Classes:
ThreadPerTaskTaskManagerControllerMixin

public interface TaskManagerController

A control interface to manage tasks.


Method Summary
 Task[] getTasks()
          Returns the tasks that have been registered.
 void interruptTask(Task task, TaskStoppedListener listener)
          Interrupts the specified task.
 Object registerTask(Task task, Map hints)
          Registers a new task.
 void unregisterTask(Task task)
          Unregisters the specified task.
 

Method Detail

registerTask

public Object registerTask(Task task,
                           Map hints)
                    throws IllegalTaskException
Registers a new task.

Parameters:
task - the task to be registered.
hints - additionnal parameters.
Returns:
an interface that can be used to control the registered task (may be null if no control is available on the task).
Throws:
IllegalTaskException - if an error occurs.

unregisterTask

public void unregisterTask(Task task)
                    throws IllegalTaskException
Unregisters the specified task.

Parameters:
task - the task to be unregistered.
Throws:
IllegalTaskException - if an error occurs.

interruptTask

public void interruptTask(Task task,
                          TaskStoppedListener listener)
                   throws IllegalTaskException
Interrupts the specified task. An interrupted task is no more executed. The given listener is notified when the task is interrupted. The interrupted task should then be unregistered from the activity manager.

Parameters:
task - the task to interrupt.
listener - the listener that is notified when the task is interrupted. Can be null.
Throws:
IllegalTaskException - if the given task is unknown.

getTasks

public Task[] getTasks()
Returns the tasks that have been registered.

Returns:
the tasks that have been registered.


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