KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mmbase > module > builders > MMEventsProbe


1 /*
2
3 This software is OSI Certified Open Source Software.
4 OSI Certified is a certification mark of the Open Source Initiative.
5
6 The license (Mozilla version 1.0) can be read at the MMBase site.
7 See http://www.MMBase.org/license
8
9 */

10 package org.mmbase.module.builders;
11
12 /**
13  * @javadoc
14  * @application Tools
15  * @version $Id: MMEventsProbe.java,v 1.7 2004/10/08 12:23:54 pierre Exp $
16  * @author Daniel Ockeloen
17  */

18 public class MMEventsProbe implements Runnable JavaDoc {
19
20     Thread JavaDoc kicker = null;
21     MMEvents parent = null;
22
23     public MMEventsProbe(MMEvents parent) {
24         this.parent = parent;
25         init();
26     }
27
28     public void init() {
29         this.start();
30     }
31
32     /**
33      * Starts the admin Thread.
34      */

35     public void start() {
36         /* Start up the main thread */
37         if (kicker == null) {
38             kicker = new Thread JavaDoc(this, "mmevents");
39             kicker.setDaemon(true);
40             kicker.start();
41         }
42     }
43
44     /**
45      * Stops the admin Thread.
46      */

47     public void stop() {
48         /* Stop thread */
49         kicker.interrupt();
50         kicker = null;
51     }
52
53     /**
54      * admin probe, try's to make a call to all the maintainance calls.
55      */

56     public void run() {
57         while (kicker != null) {
58             parent.probeCall();
59         }
60     }
61 }
Popular Tags