Interface ShutdownListener

All Known Implementing Classes:
LoggingSetupRecorder.ShutdownNotifier

public interface ShutdownListener
A listener that can be registered to control the shutdown process and implement graceful shutdown. Shutdown happens in two phases. In the pre shutdown phase the application should function normally, but should notify external systems that it is about to go away. In the shutdown phase the app should disallow new external requests, however allow existing requests to complete normally.
  • Method Details

    • preShutdown

      default void preShutdown(ShutdownListener.ShutdownNotification notification)
      Pre shutdown notification, the listener can use this to notify external systems this application is about to shut down.
      Parameters:
      notification - The notification event
    • shutdown

      default void shutdown(ShutdownListener.ShutdownNotification notification)
      The shutdown notification. The listener should start rejecting requests and wait for all existing ones to finish.
      Parameters:
      notification - The notification event