KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > compiere > server > AppsService


1 /******************************************************************************
2  * The contents of this file are subject to the Compiere License Version 1.1
3  * ("License"); You may not use this file except in compliance with the License
4  * You may obtain a copy of the License at http://www.compiere.org/license.html
5  * Software distributed under the License is distributed on an "AS IS" basis,
6  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
7  * the specific language governing rights and limitations under the License.
8  * The Original Code is Compiere ERP & CRM Business Solution
9  * The Initial Developer of the Original Code is Jorg Janke and ComPiere, Inc.
10  * Portions created by Jorg Janke are Copyright (C) 1999-2001 Jorg Janke, parts
11  * created by ComPiere are Copyright (C) ComPiere, Inc.; All Rights Reserved.
12  * Contributor(s): ______________________________________.
13  *****************************************************************************/

14 package org.compiere.server;
15
16 import javax.management.*;
17 import org.jboss.system.*;
18
19 import org.compiere.*;
20 import org.compiere.db.*;
21 import org.compiere.util.*;
22
23 /**
24  * Application Service
25  *
26  * @author Jorg Janke
27  * @version $Id: AppsService.java,v 1.19 2003/09/29 01:29:58 jjanke Exp $
28  */

29 public class AppsService extends ServiceMBeanSupport
30    implements AppsServiceMBean, Runnable JavaDoc
31 {
32     /**
33      *
34      */

35     public AppsService()
36     {
37     } // AppsService
38

39     /**
40      * Create Service
41      * @throws Exception
42      */

43     protected void createService() throws Exception JavaDoc
44     {
45 // p_worker = new Thread (this, getName());
46
// p_worker.setDaemon(true);
47
} // createService
48

49     /**
50      * Start Service
51      * @throws Exception
52      */

53     protected void startService() throws Exception JavaDoc
54     {
55 // p_worker.start();
56
} // startService
57

58     /**
59      * Stop Service
60      * @throws Exception
61      */

62     protected void stopService() throws Exception JavaDoc
63     {
64 // p_worker.interrupt();
65
}
66
67     /**
68      * Destroy Service
69      * @throws Exception
70      */

71     protected void destroyService() throws Exception JavaDoc
72     {
73         /**
74         while (p_worker.isAlive())
75         {
76             p_worker.interrupt();
77             Thread.currentThread().sleep(1000);
78         }
79         p_worker = null;
80         **/

81     } // destroyService
82

83
84     /**
85      * Run
86      */

87     public void run()
88     {
89         boolean running = true;
90         while (running)
91         {
92             try
93             {
94
95
96 // m_count++;
97
// put the thread to sleep for the interval specified
98
Thread.sleep(1000);
99             }
100             catch (InterruptedException JavaDoc e)
101             {
102                 running = false;
103             }
104         } // while running
105
} // run
106

107     /*************************************************************************/
108
109
110     /**
111      * Get Statistics
112      * @return statistical info
113      */

114     public String JavaDoc getStatistics()
115     {
116         return "Count";// + m_count;
117
} // getStatistics
118

119     /*************************************************************************/
120
121 } // AppsService
122
Popular Tags