Hi,
What would be the best way to hook the Domino jvm so that clean shutdowns of code can be conducted? I have a situation where i am using a certain pool (built by people at my company to access CICS using MQ). This pool keeps track of sessions for backend connectivity.
When using it under WebSphere it can be properly shutdown by utilizing the ServletContextListener method which triggers as WAS is taken down.
Since we don’t have anything similar i Domino, one other options is to do this:
Runtime.getRuntime().addShutdownHook(new Thread() {
public void run() {
try {
//... call session cleanup code here...
}
catch (IOException e) {
System.err.println(e);
}
}
});
of course after modifying the java.policy file to grant access for getting the Runtime (yes, i know. Not a very good thing to open up due to the fact that malicious code can prevent the JVM from shutting down in a clean way…).
The problem is that the code never fires. Not when stopping the http task or even when stopping the server.
How could this be accomplished in Domino?
Kind regards
Daniel