appengine-java-vm-runtime
appengine-java-vm-runtime copied to clipboard
Shutdown Hook
We'd really appreciate to be able to have a shutdown hook in order to clean server state (destroying connection pool to redis, to cassandra, emptying caches not yet persisted...) before shutdown.
However we didn't find any way to do so. We tried 2 solutions:
JVM way:
Runtime.getRuntime().addShutdownHook(new Thread() {
public void run() {
// cleaning
}
});
App Engine Sandbox way:
LifecycleManager.getInstance().setShutdownHook(new ShutdownHook() {
public void shutdown() {
// cleaning
}
});
None seemed to work :( If you have any idea... Thanks!