- java.lang.Object
-
- de.carne.boot.ShutdownHooks
-
public final class ShutdownHooks extends java.lang.ObjectUtility class providing the same function as Runtime.addShutdownHook(Thread) while sharing a single Thread for all hooks.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidadd(java.lang.Runnable hook)Adds a shutdown hook to be invoked during VM shutdown.static voidtrigger()Triggers execution of the registered shutdown hooks.
-
-
-
Method Detail
-
add
public static void add(java.lang.Runnable hook)
Adds a shutdown hook to be invoked during VM shutdown.- Parameters:
hook- the shutdown hook to invoke.- See Also:
Runtime.addShutdownHook(Thread)
-
trigger
public static void trigger()
Triggers execution of the registered shutdown hooks.
-
-