Created initial shutdown hook that does nothing

This commit is contained in:
hns 2002-11-06 11:00:48 +00:00
parent dfc2431343
commit 2b5057e136
2 changed files with 22 additions and 1 deletions

View file

@ -0,0 +1,20 @@
// HelmaShutdownHook.java
package helma.main;
/**
* ShutdownHook that shuts down all running Helma applications on exit.
*/
public class HelmaShutdownHook extends Thread {
ApplicationManager appmgr;
public HelmaShutdownHook (ApplicationManager appmgr) {
this.appmgr = appmgr;
}
public void run () {
System.err.print ("Shutting down Helma...");
System.err.println ("done");
}
}

View file

@ -356,12 +356,13 @@ import org.apache.xmlrpc.*;
LocateRegistry.createRegistry (rmiPort);
}
// create application manager
appManager = new ApplicationManager (rmiPort, hopHome, appsProps, this);
if (xmlrpc != null)
xmlrpc.addHandler ("$default", appManager);
// add shutdown hook to close running apps and servers on exit
Runtime.getRuntime().addShutdownHook (new HelmaShutdownHook(appManager));
} catch (Exception gx) {
getLogger().log ("Error initializing embedded database: "+gx);