KickJava   Java API By Example, From Geeks To Geeks.

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


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 manage tasks.
31  */

32 public interface TaskManagerController
33 {
34
35   /**
36    * Registers a new task.
37    *
38    * @param task the task to be registered.
39    * @param hints additionnal parameters.
40    * @return an interface that can be used to control the registered task (may
41    * be <code>null</code> if no control is available on the task).
42    * @throws IllegalTaskException if an error occurs.
43    */

44   Object JavaDoc registerTask(Task task, Map JavaDoc hints) throws IllegalTaskException;
45
46   /**
47    * Unregisters the specified task.
48    *
49    * @param task the task to be unregistered.
50    * @throws IllegalTaskException if an error occurs.
51    */

52   void unregisterTask(Task task) throws IllegalTaskException;
53
54   /**
55    * Interrupts the specified task. An interrupted task is no more executed. The
56    * given <code>listener</code> is notified when the task is interrupted. The
57    * interrupted task should then be unregistered from the activity manager.
58    *
59    * @param task the task to interrupt.
60    * @param listener the listener that is notified when the task is interrupted.
61    * Can be <code>null</code>.
62    * @throws IllegalTaskException if the given task is unknown.
63    */

64   void interruptTask(Task task, TaskStoppedListener listener)
65       throws IllegalTaskException;
66
67   /**
68    * Returns the tasks that have been registered.
69    *
70    * @return the tasks that have been registered.
71    */

72   Task[] getTasks();
73 }
Popular Tags