public interface AppLifecycle
Application lifecycle support.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptiondefault booleanisAlive()Return true if status starting or started (the server is coming up).default booleanisReady()Return true the server has started.voidonShutdown(Runnable onShutdown) Register a Runnable to run on shutdown of the server.voidonShutdown(Runnable onShutdown, int order) Register a Runnable to run on shutdown of the server with ordering.voidregisterShutdownHook(Runnable onShutdown) Register the runnable with the Runtime as a shutdown hook.status()Return the current status.voidstatus(AppLifecycle.Status newStatus) Set the current status.
-
Method Details
-
onShutdown
Register a Runnable to run on shutdown of the server.This will execute after the server has deemed there are no active requests.
-
onShutdown
Register a Runnable to run on shutdown of the server with ordering.The runnables are executed with order from low to high (0 means run first).
This will execute after the server has deemed there are no active requests.
- Parameters:
onShutdown- The function to run on shutdownorder- The relative order to execute with 0 meaning run first
-
registerShutdownHook
Register the runnable with the Runtime as a shutdown hook. -
status
AppLifecycle.Status status()Return the current status. -
status
Set the current status. -
isAlive
default boolean isAlive()Return true if status starting or started (the server is coming up). -
isReady
default boolean isReady()Return true the server has started.
-