Class AbstractShutdownHook

    • Field Detail

      • m_Hook

        protected Thread m_Hook
        the installed hook.
    • Constructor Detail

      • AbstractShutdownHook

        public AbstractShutdownHook()
    • 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)