01: // ServerShutdownHook.java
02: // $Id: ServerShutdownHook.java,v 1.4 2000/08/16 21:37:35 ylafon Exp $
03: // (c) COPYRIGHT MIT, INRIA and Keio, 2000.
04: // Please first read the full copyright statement in file COPYRIGHT.html
05:
06: package org.w3c.jigsaw.daemon;
07:
08: /**
09: * The shutdown hook used to handle ctrl-c and such
10: * NOTE, should work with jdk1.3
11: */
12: class ServerShutdownHook extends Thread {
13: private static final boolean debug = false;
14:
15: private ServerHandlerManager shm = null;
16:
17: /**
18: * shut down everything then exit
19: */
20: public void run() {
21: if (debug)
22: System.out.println("*** ShutdownHook, synching");
23: shm.shutdown();
24: }
25:
26: ServerShutdownHook(ServerHandlerManager shm) {
27: super();
28: this.shm = shm;
29: }
30: }
|