KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mmbase > applications > packaging > installhandlers > uninstallThread


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

7 package org.mmbase.applications.packaging.installhandlers;
8
9 import org.mmbase.applications.packaging.UninstallManager;
10 import org.mmbase.util.logging.Logger;
11 import org.mmbase.util.logging.Logging;
12
13 /**
14  * @author Daniel Ockeloen
15  *
16  * background hanlder for sending email, a call backthread
17  * that is used to send email (one thread per active email
18  * node)
19  * @created July 20, 2004
20  */

21 public class uninstallThread implements Runnable JavaDoc {
22
23     // logger
24
private static Logger log = Logging.getLoggerInstance(uninstallThread.class);
25
26     // Thread
27
Thread JavaDoc kicker = null;
28
29
30     /**
31      * create a background thread with given email node
32      */

33     public uninstallThread() {
34         init();
35     }
36
37
38     /**
39      * init the thread
40      */

41     public void init() {
42         this.start();
43     }
44
45
46     /**
47      * Starts the main Thread.
48      */

49     public void start() {
50         /*
51          * Start up the main thread
52          */

53         if (kicker == null) {
54             kicker = new Thread JavaDoc(this, "uninstallthread");
55             kicker.start();
56         }
57     }
58
59
60     /**
61      * Main run, exception protected
62      */

63     public void run() {
64         try {
65             doWork();
66         } catch (Exception JavaDoc e) {
67             log.error("run(): ERROR: Exception in uninstallThread thread!");
68             log.error(Logging.stackTrace(e));
69         }
70     }
71
72
73     /**
74      * Main work handelr
75      */

76     public void doWork() {
77         UninstallManager.performUninstall();
78     }
79
80 }
81
82
Popular Tags