01: package org.mortbay.jetty.win32service;
02:
03: import org.mortbay.component.AbstractLifeCycle;
04: import org.mortbay.jetty.Server;
05: import org.tanukisoftware.wrapper.WrapperManager;
06:
07: public class Win32Service extends AbstractLifeCycle implements Runnable {
08: private Server server;
09:
10: public void doStart() {
11:
12: JettyServiceWrapperListener.setServer(server);
13:
14: }
15:
16: public void doStop() {
17: System.out
18: .println("Listener is stopping Jetty Service Instance!!!");
19:
20: }
21:
22: public void run() {
23: doStop();
24:
25: }
26:
27: public void stopServer() {
28: try {
29: System.out.println("Thread Test Stopper!!!");
30: server.stop();
31: //WrapperManager.stop(0);
32: } catch (Exception e) {
33: e.printStackTrace();
34: }
35: }
36:
37: public Server getServer() {
38: return server;
39: }
40:
41: public void setServer(Server server) {
42: this.server = server;
43: }
44:
45: }
|