Class WebServerGracefulShutdownLifecycle

java.lang.Object
org.springframework.boot.web.server.context.WebServerGracefulShutdownLifecycle
All Implemented Interfaces:
org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle

public final class WebServerGracefulShutdownLifecycle extends Object implements org.springframework.context.SmartLifecycle
SmartLifecycle to trigger WebServer graceful shutdown.
Since:
2.5.0
  • Field Details

  • Constructor Details

    • WebServerGracefulShutdownLifecycle

      public WebServerGracefulShutdownLifecycle(WebServer webServer)
      Creates a new WebServerGracefulShutdownLifecycle that will gracefully shut down the given webServer.
      Parameters:
      webServer - web server to shut down gracefully
  • Method Details

    • start

      public void start()
      Specified by:
      start in interface org.springframework.context.Lifecycle
    • stop

      public void stop()
      Specified by:
      stop in interface org.springframework.context.Lifecycle
    • stop

      public void stop(Runnable callback)
      Specified by:
      stop in interface org.springframework.context.SmartLifecycle
    • isRunning

      public boolean isRunning()
      Specified by:
      isRunning in interface org.springframework.context.Lifecycle
    • getPhase

      public int getPhase()
      Specified by:
      getPhase in interface org.springframework.context.Phased
      Specified by:
      getPhase in interface org.springframework.context.SmartLifecycle
    • isPauseable

      public boolean isPauseable()
      Specified by:
      isPauseable in interface org.springframework.context.SmartLifecycle