public final class ShutdownHooks
extends java.lang.Object
This class exists mostly because hooks registered via Runtime.addShutdownHook(java.lang.Thread)
are not guaranteed to run
when shutting down a JavaFX application, and because they run in a nondeterministic order.
Modifier and Type | Class and Description |
---|---|
static interface |
ShutdownHooks.Hook |
Modifier and Type | Method and Description |
---|---|
static void |
addHook(ShutdownHooks.Hook hook)
Adds a hook to be run at shutdown.
|
static void |
removeHook(ShutdownHooks.Hook hook)
Removes a hook from running at shutdown.
|
static void |
runAllHooks()
Runs all hooks.
|
public static void addHook(ShutdownHooks.Hook hook)
public static void removeHook(ShutdownHooks.Hook hook)
public static void runAllHooks()
UncaughtExceptionHandler
.