--- /dev/null
+// ServerShutdownHook.java\r
+// $Id: ServerShutdownHook.java,v 1.1 2010/06/15 12:26:08 smhuang Exp $\r
+// (c) COPYRIGHT MIT, INRIA and Keio, 2000.\r
+// Please first read the full copyright statement in file COPYRIGHT.html\r
+\r
+package org.w3c.jigsaw.daemon;\r
+\r
+/**\r
+ * The shutdown hook used to handle ctrl-c and such\r
+ * NOTE, should work with jdk1.3\r
+ */\r
+class ServerShutdownHook extends Thread {\r
+ private static final boolean debug = false;\r
+\r
+ private ServerHandlerManager shm = null;\r
+\r
+ /**\r
+ * shut down everything then exit\r
+ */\r
+ public void run() {\r
+ if (debug)\r
+ System.out.println("*** ShutdownHook, synching");\r
+ shm.shutdown();\r
+ }\r
+\r
+ ServerShutdownHook(ServerHandlerManager shm) {\r
+ super();\r
+ this.shm = shm;\r
+ }\r
+}\r