KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > winstone > ShutdownHook


1 /*
2  * Copyright 2003-2006 Rick Knowles <winstone-devel at lists sourceforge net>
3  * Distributed under the terms of either:
4  * - the common development and distribution license (CDDL), v1.0; or
5  * - the GNU Lesser General Public License, v2.1 or later
6  */

7 package winstone;
8
9 /**
10  * A jvm hook to force the calling of the web-app destroy before the process terminates
11  *
12  * @author <a HREF="mailto:rick_knowles@hotmail.com">Rick Knowles</a>
13  * @version $Id: ShutdownHook.java,v 1.3 2006/02/28 07:32:47 rickknowles Exp $
14  */

15 public class ShutdownHook extends Thread JavaDoc {
16     private Launcher launcher;
17
18     public ShutdownHook(Launcher launcher) {
19         this.launcher = launcher;
20     }
21
22     public void run() {
23         if (this.launcher != null)
24             this.launcher.shutdown();
25     }
26 }
27
Popular Tags