Shutdown manager (untested on Windows).

This commit is contained in:
akwizgran
2011-11-18 17:13:55 +00:00
parent 859ece6328
commit 046becd388
22 changed files with 467 additions and 96 deletions

View File

@@ -0,0 +1,16 @@
package net.sf.briar.api.lifecycle;
public interface ShutdownManager {
/**
* Registers a hook to be run when the JVM shuts down and returns a handle
* that can be used to remove the hook.
*/
int addShutdownHook(Runnable hook);
/**
* Removes the shutdown hook identified by the given handle and returns
* true if the hook was removed.
*/
boolean removeShutdownHook(int handle);
}