KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > dream > control > activity > Util


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

23
24 package org.objectweb.dream.control.activity;
25
26 import java.util.Map JavaDoc;
27
28 import org.objectweb.dream.control.activity.task.IllegalTaskException;
29 import org.objectweb.dream.control.activity.task.Task;
30 import org.objectweb.dream.control.activity.task.TaskController;
31 import org.objectweb.dream.util.Dream;
32 import org.objectweb.fractal.api.Component;
33 import org.objectweb.fractal.api.NoSuchInterfaceException;
34
35 /**
36  * Utility methods to manage tasks.
37  */

38 public final class Util
39 {
40
41   private Util()
42   {
43   }
44
45   /**
46    * Adds the given task in the task controller of the given component.
47    *
48    * @param component the component interface which should provide the
49    * {@link TaskController}control interface.
50    * @param task the task to add
51    * @param registrationHints the hints passed to the
52    * {@link TaskController#addTask(Task, Map)}method.
53    * @throws NoSuchInterfaceException If the given component doesn't have a task
54    * controller interface.
55    * @throws IllegalTaskException If the given task can't be added to the task
56    * controller.
57    */

58   public static void addTask(Component component, Task task,
59       Map JavaDoc registrationHints) throws NoSuchInterfaceException,
60       IllegalTaskException
61   {
62     TaskController taskController = Dream.getTaskController(component);
63     taskController.addTask(task, registrationHints);
64   }
65 }
Popular Tags