Interface ShutdownHooks.Action

Enclosing class:
ShutdownHooks
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface ShutdownHooks.Action
  • Method Details

    • perform

      void perform() throws Exception
      Performs the action associated with the shutdown hook.
      Throws:
      Exception - any exception will be logged and the next action performed.
    • performNoThrow

      default void performNoThrow()
      Performs the action without throwing. The default implementation merely logs the exception.
    • andThen

      Generates a new ShutdownHooks.Action from the the supplied action. The resulting ShutdownHooks.Action will first execute this instance followed immediately by the next action.
      Parameters:
      next - the next action to perform.
      Returns:
    • andThen

      default ShutdownHooks.Action andThen(Object context, ShutdownHooks.Action next)
      Identical to andThen(Action), but allows for some additional logging and associated context.
      Parameters:
      context - the context, which will be logged using Object.toString()
      next - the next action to perform
      Returns:
      a new instance
    • getLogger

      default org.slf4j.Logger getLogger()
      Gets the Logger which to use when logging the shutdown hook's actions. By default this gets the logger associated with ShutdownHooks.
      Returns:
      the logger instance