mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 19:29:06 +01:00
Shutdown manager (untested on Windows).
This commit is contained in:
16
api/net/sf/briar/api/lifecycle/ShutdownManager.java
Normal file
16
api/net/sf/briar/api/lifecycle/ShutdownManager.java
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user