01: package de.webman.util.scheduler;
02:
03: import org.apache.log4j.Category;
04:
05: /**
06: * This starter is a single thread to start a service.<p>
07: *
08: * Should be a private or package class inside {@link
09: * de.webman.util.scheduler.SchedulerMgr}, but this is not allowed by
10: * JTest. So its here.
11: *
12: * @author <a href="mailto:gregor.klinke@webman.de">Gregor Klinke</a>
13: * @version $Revision: 1.2 $
14: **/
15: public class ServiceThread implements Runnable {
16: /* $Id: ServiceThread.java,v 1.2 2002/04/12 12:45:53 gregor Exp $ */
17: /**
18: * the logging facility
19: **/
20: private static Category cat = Category
21: .getInstance(ServiceThread.class);
22:
23: /**
24: * identification string
25: **/
26: private String id = "";
27:
28: /**
29: * the service to run
30: **/
31: private SchedulerService srv = null;
32:
33: /**
34: * the constructor, only to be used by {@link
35: * de.webman.util.scheduler.SchedulerMgr}
36: * @param _id the id to be used for the service to start
37: * @param _srv the service to use
38: **/
39: ServiceThread(String _id, SchedulerService _srv) {
40: srv = _srv;
41: id = _id;
42: }
43:
44: /**
45: * take off ...
46: **/
47: public void run() {
48: try {
49: cat.debug("execute scheduling service: '" + id + "'");
50: srv.execute();
51: } catch (SchedulerException e) {
52: cat
53: .error("catch scheduling exception during executing of service '"
54: + id + "': " + e);
55: }
56:
57: /* ends */
58: }
59: }
60:
61: /*
62: $Log: ServiceThread.java,v $
63: Revision 1.2 2002/04/12 12:45:53 gregor
64: merge result (WM-1_6_3-1_5_0)
65:
66: Revision 1.1.2.1 2002/03/25 16:18:32 gregor
67: an extensible, generic scheduler implementation
68:
69: Revision 1.2 2001/11/15 13:52:31 gregor
70: added comment, &c.
71:
72: */
|