Module de.carne
Package de.carne.boot

Class ShutdownHooks


  • public final class ShutdownHooks
    extends java.lang.Object
    Utility 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 void add​(java.lang.Runnable hook)
      Adds a shutdown hook to be invoked during VM shutdown.
      static void trigger()
      Triggers execution of the registered shutdown hooks.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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.