public final class WebServerGracefulShutdownLifecycle
extends java.lang.Object
implements org.springframework.context.SmartLifecycle
SmartLifecycle to trigger WebServer graceful shutdown.| Modifier and Type | Field and Description |
|---|---|
static int |
SMART_LIFECYCLE_PHASE
SmartLifecycle phase in which graceful shutdown
of the web server is performed. |
| Constructor and Description |
|---|
WebServerGracefulShutdownLifecycle(WebServer webServer)
Creates a new
WebServerGracefulShutdownLifecycle that will gracefully shut
down the given webServer. |
| Modifier and Type | Method and Description |
|---|---|
int |
getPhase() |
boolean |
isRunning() |
void |
start() |
void |
stop() |
void |
stop(java.lang.Runnable callback) |
public static final int SMART_LIFECYCLE_PHASE
SmartLifecycle phase in which graceful shutdown
of the web server is performed.public WebServerGracefulShutdownLifecycle(WebServer webServer)
WebServerGracefulShutdownLifecycle that will gracefully shut
down the given webServer.webServer - web server to shut down gracefullypublic void start()
start in interface org.springframework.context.Lifecyclepublic void stop()
stop in interface org.springframework.context.Lifecyclepublic void stop(java.lang.Runnable callback)
stop in interface org.springframework.context.SmartLifecyclepublic boolean isRunning()
isRunning in interface org.springframework.context.Lifecyclepublic int getPhase()
getPhase in interface org.springframework.context.PhasedgetPhase in interface org.springframework.context.SmartLifecycle