KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > ubik > rmi > server > UbikTaskManager


1 package org.sapia.ubik.rmi.server;
2
3 import org.sapia.taskman.TaskManager;
4 import org.sapia.taskman.TaskOutput;
5
6
7 /**
8  * @author Yanick Duchesne
9  * <dl>
10  * <dt><b>Copyright:</b><dd>Copyright &#169; 2002-2003 <a HREF="http://www.sapia-oss.org">Sapia Open Source Software</a>. All Rights Reserved.</dd></dt>
11  * <dt><b>License:</b><dd>Read the license.txt file of the jar or visit the
12  * <a HREF="http://www.sapia-oss.org/license.html">license page</a> at the Sapia OSS web site</dd></dt>
13  * </dl>
14  */

15 public class UbikTaskManager extends TaskManager {
16   public UbikTaskManager() {
17     super("ubik.rmi.TaskManager");
18     super.setDaemon(true);
19     super.setRunInterval(2000);
20     super.start();
21   }
22
23   /**
24    * @see org.sapia.taskman.TaskManager#newTaskOutput(String)
25    */

26   protected TaskOutput newTaskOutput(String JavaDoc taskName) {
27     return new UbikTaskOutput(taskName);
28   }
29
30   /*////////////////////////////////////////////////////////////////////
31                                INNER CLASSES
32   ////////////////////////////////////////////////////////////////////*/

33   static class UbikTaskOutput implements TaskOutput {
34     private String JavaDoc _taskName;
35
36     UbikTaskOutput(String JavaDoc taskName) {
37       _taskName = taskName;
38     }
39
40     /**
41      * @see org.sapia.taskman.TaskOutput#close()
42      */

43     public void close() {
44     }
45
46     /**
47      * @see org.sapia.taskman.TaskOutput#debug(Object)
48      */

49     public TaskOutput debug(Object JavaDoc msg) {
50       Log.debug(_taskName, msg);
51
52       return this;
53     }
54
55     /**
56      * @see org.sapia.taskman.TaskOutput#error(Object, Throwable)
57      */

58     public TaskOutput error(Object JavaDoc msg, Throwable JavaDoc err) {
59       Log.error(_taskName, msg, err);
60
61       return this;
62     }
63
64     /**
65      * @see org.sapia.taskman.TaskOutput#error(Object)
66      */

67     public TaskOutput error(Object JavaDoc msg) {
68       Log.error(_taskName, msg);
69
70       return this;
71     }
72
73     /**
74      * @see org.sapia.taskman.TaskOutput#error(Throwable)
75      */

76     public TaskOutput error(Throwable JavaDoc err) {
77       Log.error(_taskName, err);
78
79       return this;
80     }
81
82     /**
83      * @see org.sapia.taskman.TaskOutput#info(Object)
84      */

85     public TaskOutput info(Object JavaDoc msg) {
86       Log.info(_taskName, msg);
87
88       return this;
89     }
90
91     /**
92      * @see org.sapia.taskman.TaskOutput#setTaskName(String)
93      */

94     public void setTaskName(String JavaDoc name) {
95       _taskName = name;
96     }
97
98     /**
99      * @see org.sapia.taskman.TaskOutput#warning(Object)
100      */

101     public TaskOutput warning(Object JavaDoc msg) {
102       Log.error(_taskName, msg);
103
104       return this;
105     }
106   }
107 }
108
Popular Tags