Class AbstractBuiltInShutdownHook

    • Constructor Detail

      • AbstractBuiltInShutdownHook

        public AbstractBuiltInShutdownHook()
    • Method Detail

      • check

        public String check()
        Hook method before generating the runnable and installing it.
        Default implementation just returns null.
        Returns:
        null if successful, otherwise error message
      • configure

        public abstract Runnable configure()
        Configures the runnable that gets executed when shutting down.
        Returns:
        the runnable
      • install

        public String install()
        Installs the hook, if possible.
        Returns:
        null if successful, otherwise error message
      • remove

        public boolean remove()
        Removes the hook, if possible.
        Returns:
        true if successfully removed (or not installed)
      • installAll

        public static void installAll()
        Installs all the built-in shutdown hooks.
      • removeAll

        public static void removeAll()
        Removes all the installed built-in shutdown hooks.