Class WebServerGracefulShutdownLifecycle
java.lang.Object
org.springframework.boot.web.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 SummaryFieldsModifier and TypeFieldDescriptionstatic final intSmartLifecycle phasein which graceful shutdown of the web server is performed.Fields inherited from interface org.springframework.context.SmartLifecycleDEFAULT_PHASE
- 
Constructor SummaryConstructorsConstructorDescriptionWebServerGracefulShutdownLifecycle(WebServer webServer) Creates a newWebServerGracefulShutdownLifecyclethat will gracefully shut down the givenwebServer.
- 
Method SummaryMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.SmartLifecycleisAutoStartup
- 
Field Details- 
SMART_LIFECYCLE_PHASEpublic static final int SMART_LIFECYCLE_PHASESmartLifecycle phasein which graceful shutdown of the web server is performed.- See Also:
 
 
- 
- 
Constructor Details- 
WebServerGracefulShutdownLifecycleCreates a newWebServerGracefulShutdownLifecyclethat will gracefully shut down the givenwebServer.- Parameters:
- webServer- web server to shut down gracefully
 
 
- 
- 
Method Details- 
startpublic void start()- Specified by:
- startin interface- org.springframework.context.Lifecycle
 
- 
stoppublic void stop()- Specified by:
- stopin interface- org.springframework.context.Lifecycle
 
- 
stop- Specified by:
- stopin interface- org.springframework.context.SmartLifecycle
 
- 
isRunningpublic boolean isRunning()- Specified by:
- isRunningin interface- org.springframework.context.Lifecycle
 
- 
getPhasepublic int getPhase()- Specified by:
- getPhasein interface- org.springframework.context.Phased
- Specified by:
- getPhasein interface- org.springframework.context.SmartLifecycle
 
 
-