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

All Known Implementing Classes:
BasicTaskControllerMixin

public interface TaskController

A control interface to control tasks of the active component to which this interface belongs.


Method Summary
 void addTask(Task task, Map hints)
          Adds a new task in this controller
 Object getTaskControl(Task task)
          Returns an interface that can be used to control a task (may be null if no control is available for the task).
 Task[] getTasks()
          Returns the tasks of the component to which this interface belongs.
 void removeTask(Task task)
          Removes a task.
 

Method Detail

getTasks

public Task[] getTasks()
Returns the tasks of the component to which this interface belongs.

Returns:
an array of task.

addTask

public void addTask(Task task,
                    Map hints)
             throws IllegalTaskException
Adds a new task in this controller

Parameters:
task - a new task.
hints - registration hints. It can contains the name of the controller descriptor of the created component task, with the key "taskControllerDesc". If no setted, use primitiveTask controller descriptor.
This parameter cannot be null.
Throws:
IllegalTaskException - if the task component can't be registered.

removeTask

public void removeTask(Task task)
                throws NoSuchTaskException,
                       IllegalTaskException
Removes a task. The controller unregisters the task (if registered) and remove it.

Parameters:
task - the task to remove.
Throws:
NoSuchTaskException - if the given task component is unknown.
IllegalTaskException - if the given task can't be unregistered.

getTaskControl

public Object getTaskControl(Task task)
                      throws NoSuchTaskException,
                             IllegalTaskException
Returns an interface that can be used to control a task (may be null if no control is available for the task). The runtime type of the interface depends on the implementation of the activity manager and on the hints that have been given as paremeters of the registration method of the activity manager.

Parameters:
task - a task.
Returns:
an interface that can be used to control a task (may be null)
Throws:
NoSuchTaskException - if the given task component is unknown.
IllegalTaskException - if the given task is not currently registered.
See Also:
addTask(Task, Map)


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