Class WebServerGracefulShutdownLifecycle
java.lang.Object
org.springframework.boot.web.context.WebServerGracefulShutdownLifecycle
- All Implemented Interfaces:
 Lifecycle,Phased,SmartLifecycle
SmartLifecycle to trigger WebServer graceful shutdown.- Since:
 - 2.5.0
 - Author:
 - Andy Wilkinson
 
- 
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intSmartLifecycle phasein which graceful shutdown of the web server is performed.Fields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE - 
Constructor Summary
ConstructorsConstructorDescriptionWebServerGracefulShutdownLifecycle(WebServer webServer) Creates a newWebServerGracefulShutdownLifecyclethat will gracefully shut down the givenwebServer. - 
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.SmartLifecycle
isAutoStartup 
- 
Field Details
- 
SMART_LIFECYCLE_PHASE
public static final int SMART_LIFECYCLE_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
public void start() - 
stop
public void stop() - 
stop
- Specified by:
 stopin interfaceSmartLifecycle
 - 
isRunning
public boolean isRunning() - 
getPhase
public int getPhase()- Specified by:
 getPhasein interfacePhased- Specified by:
 getPhasein interfaceSmartLifecycle
 
 -