KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > de > webman > util > scheduler > ServiceThread


1 package de.webman.util.scheduler;
2
3 import org.apache.log4j.Category;
4
5
6 /**
7  * This starter is a single thread to start a service.<p>
8  *
9  * Should be a private or package class inside {@link
10  * de.webman.util.scheduler.SchedulerMgr}, but this is not allowed by
11  * JTest. So its here.
12  *
13  * @author <a HREF="mailto:gregor.klinke@webman.de">Gregor Klinke</a>
14  * @version $Revision: 1.2 $
15  **/

16 public class ServiceThread
17     implements Runnable JavaDoc
18 {
19     /* $Id: ServiceThread.java,v 1.2 2002/04/12 12:45:53 gregor Exp $ */
20     /**
21      * the logging facility
22      **/

23     private static Category cat = Category.getInstance(ServiceThread.class);
24
25     /**
26      * identification string
27      **/

28     private String JavaDoc id = "";
29
30     /**
31      * the service to run
32      **/

33     private SchedulerService srv = null;
34     
35     
36     /**
37      * the constructor, only to be used by {@link
38      * de.webman.util.scheduler.SchedulerMgr}
39      * @param _id the id to be used for the service to start
40      * @param _srv the service to use
41      **/

42     ServiceThread(String JavaDoc _id, SchedulerService _srv) {
43         srv = _srv;
44         id = _id;
45     }
46     
47     /**
48      * take off ...
49      **/

50     public void run() {
51         try {
52             cat.debug ("execute scheduling service: '" + id + "'");
53             srv.execute();
54         }
55         catch (SchedulerException e) {
56             cat.error("catch scheduling exception during executing of service '" + id + "': " + e);
57         }
58         
59         /* ends */
60     }
61 }
62
63 /*
64   $Log: ServiceThread.java,v $
65   Revision 1.2 2002/04/12 12:45:53 gregor
66   merge result (WM-1_6_3-1_5_0)
67
68   Revision 1.1.2.1 2002/03/25 16:18:32 gregor
69   an extensible, generic scheduler implementation
70
71   Revision 1.2 2001/11/15 13:52:31 gregor
72   added comment, &c.
73
74 */

75
Popular Tags