Created initial shutdown hook that does nothing
This commit is contained in:
parent
dfc2431343
commit
2b5057e136
2 changed files with 22 additions and 1 deletions
20
src/helma/main/HelmaShutdownHook.java
Normal file
20
src/helma/main/HelmaShutdownHook.java
Normal 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");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -356,12 +356,13 @@ import org.apache.xmlrpc.*;
|
||||||
LocateRegistry.createRegistry (rmiPort);
|
LocateRegistry.createRegistry (rmiPort);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// create application manager
|
// create application manager
|
||||||
appManager = new ApplicationManager (rmiPort, hopHome, appsProps, this);
|
appManager = new ApplicationManager (rmiPort, hopHome, appsProps, this);
|
||||||
if (xmlrpc != null)
|
if (xmlrpc != null)
|
||||||
xmlrpc.addHandler ("$default", appManager);
|
xmlrpc.addHandler ("$default", appManager);
|
||||||
|
|
||||||
|
// add shutdown hook to close running apps and servers on exit
|
||||||
|
Runtime.getRuntime().addShutdownHook (new HelmaShutdownHook(appManager));
|
||||||
|
|
||||||
} catch (Exception gx) {
|
} catch (Exception gx) {
|
||||||
getLogger().log ("Error initializing embedded database: "+gx);
|
getLogger().log ("Error initializing embedded database: "+gx);
|
||||||
|
|
Loading…
Add table
Reference in a new issue