KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > dream > control > activity > task > TaskController


1 /**
2  * Dream
3  * Copyright (C) 2003-2004 INRIA Rhone-Alpes
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Contact : dream@objectweb.org
20  *
21  * Initial developer(s): Vivien Quema
22  * Contributor(s): Matthieu Leclercq
23  */

24
25 package org.objectweb.dream.control.activity.task;
26
27 import java.util.Map JavaDoc;
28
29 /**
30  * A control interface to control tasks of the active component to which this
31  * interface belongs.
32  */

33 public interface TaskController
34 {
35
36   /**
37    * Returns the tasks of the component to which this interface belongs.
38    *
39    * @return an array of task.
40    */

41   Task[] getTasks();
42
43   /**
44    * Adds a new task in this controller
45    *
46    * @param task a new task.
47    * @param hints registration hints. It can contains the name of the controller
48    * descriptor of the created component task, with the key
49    * <code>"taskControllerDesc"</code>. If no setted, use
50    * <code>primitiveTask</code> controller descriptor. <br>
51    * This parameter cannot be <code>null</code>.
52    * @throws IllegalTaskException if the task component can't be registered.
53    */

54   void addTask(Task task, Map JavaDoc hints) throws IllegalTaskException;
55
56   /**
57    * Removes a task. The controller unregisters the task (if registered) and
58    * remove it.
59    *
60    * @param task the task to remove.
61    * @throws NoSuchTaskException if the given task component is unknown.
62    * @throws IllegalTaskException if the given task can't be unregistered.
63    */

64   void removeTask(Task task) throws NoSuchTaskException, IllegalTaskException;
65
66   /**
67    * Returns an interface that can be used to control a task (may be
68    * <code>null</code> if no control is available for the task). The runtime
69    * type of the interface depends on the implementation of the activity manager
70    * and on the <code>hints</code> that have been given as paremeters of the
71    * registration method of the activity manager.
72    *
73    * @param task a task.
74    * @return an interface that can be used to control a task (may be
75    * <code>null</code>)
76    * @throws NoSuchTaskException if the given task component is unknown.
77    * @throws IllegalTaskException if the given task is not currently registered.
78    * @see #addTask(Task, Map)
79    */

80   Object JavaDoc getTaskControl(Task task) throws NoSuchTaskException,
81       IllegalTaskException;
82 }
Popular Tags