public class ShutdownHooks
extends java.lang.Object
Runtime.addShutdownHook(java.lang.Thread) implementation available on scala.js. The hooks may be added
with a priority that controls the order in which the hooks run. Lower values run first.| Constructor and Description |
|---|
ShutdownHooks() |
| Modifier and Type | Method and Description |
|---|---|
static int |
addHook(int priority,
java.lang.Runnable runnable)
Add a removable hook to run at shutdown.
|
static void |
removeHook(int id)
Remove a shutdown hook that was added via
addHook(int, Runnable). |
public static int addHook(int priority,
java.lang.Runnable runnable)
priority - controls the ordering of this hook. Lower values run first.runnable - the shutdown task to runpublic static void removeHook(int id)
addHook(int, Runnable).id - the id returned by addHook(int, Runnable)