Interface ShutdownManager


public interface ShutdownManager
Interface used by shutdown managers to allow for thread safe adding and removing of shutdown listeners.
  • Method Details

    • addShutdownListener

      void addShutdownListener(ShutdownListener listener)
      Adds a ShutdownListener to this ShutdownManager with the default priority.

      If shutdown() has already been called, the listener should immediately be invoked.

      Parameters:
      listener - The listener to be added.
    • addShutdownListener

      void addShutdownListener(ShutdownListener listener, ShutdownPriority priority)
      Adds a ShutdownListener to this ShutdownManager with the supplied priority.

      If shutdown() has already been called, the listener should immediately be invoked.

      Parameters:
      listener - The listener to be added.
      priority - The priority of the listener when added.
    • replaceShutdownListener

      void replaceShutdownListener(ShutdownListener oldListener, ShutdownListener newListener, ShutdownPriority priority)
      Replaces an existing ShutdownListener with the new ShutdownListener.

      If shutdown() has already been called, the new listener should immediately be invoked.

      Parameters:
      oldListener - To be replaced.
      newListener - The replacement.
      priority - Replacement listeners priority.
    • removeShutdownListener

      void removeShutdownListener(ShutdownListener listener)
      Removes a ShutdownListener from this ShutdownManager.
      Parameters:
      listener - The listener to be removed.
    • shutdown

      void shutdown()
      Shuts down all the listeners in this ShutdownManager.
    • isShutdown

      boolean isShutdown()
      Find out whether the shutdown has been triggered.
      Returns:
      true if the shutdown() method has been called.