Class WebServerGracefulShutdownLifecycle
java.lang.Object
org.springframework.boot.web.server.context.WebServerGracefulShutdownLifecycle
- All Implemented Interfaces:
Lifecycle, Phased, SmartLifecycle
SmartLifecycle to trigger WebServer graceful shutdown.- Since:
- 4.0.0
- Author:
- Andy Wilkinson
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDeprecated, for removal: This API element is subject to removal in a future version.Fields inherited from interface SmartLifecycle
DEFAULT_PHASE -
Constructor Summary
ConstructorsConstructorDescriptionWebServerGracefulShutdownLifecycle(WebServer webServer) Creates a newWebServerGracefulShutdownLifecyclethat will gracefully shut down the givenwebServer. -
Method Summary
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface SmartLifecycle
isAutoStartup
-
Field Details
-
SMART_LIFECYCLE_PHASE
Deprecated, for removal: This API element is subject to removal in a future version.as of 4.0.0 in favor ofWebServerApplicationContext.GRACEFUL_SHUTDOWN_PHASESmartLifecycle phasein which graceful shutdown of the web server is performed.- See Also:
-
-
Constructor Details
-
WebServerGracefulShutdownLifecycle
Creates a newWebServerGracefulShutdownLifecyclethat will gracefully shut down the givenwebServer.- Parameters:
webServer- web server to shut down gracefully
-
-
Method Details
-
start
-
stop
-
stop
- Specified by:
stopin interfaceSmartLifecycle
-
isRunning
-
getPhase
public int getPhase()- Specified by:
getPhasein interfacePhased- Specified by:
getPhasein interfaceSmartLifecycle
-
isPauseable
public boolean isPauseable()- Specified by:
isPauseablein interfaceSmartLifecycle
-
WebServerApplicationContext.GRACEFUL_SHUTDOWN_PHASE