public interface SpringApplicationShutdownHandlers
shutdown hooks
except that they run sequentially rather than concurrently.
Shutdown handlers are guaranteed to be called only after registered
ApplicationContext
instances have been closed and are no longer active.
SpringApplication.getShutdownHandlers()
,
SpringApplication.setRegisterShutdownHook(boolean)
Modifier and Type | Method and Description |
---|---|
void |
add(Runnable action)
Add an action to the handlers that will be run when the JVM exits.
|
void |
remove(Runnable action)
Remove a previously added an action so that it no longer runs when the JVM exits.
|
void add(Runnable action)
action
- the action to addvoid remove(Runnable action)
action
- the action to remove