public class ShutdownNotifier extends Object
| Constructor and Description |
|---|
ShutdownNotifier() |
| Modifier and Type | Method and Description |
|---|---|
void |
prepareForShutdown()
Will call
ShutdownListener.prepareForShutdown() for each registered listener
asynchronously, and waiting a total of five seconds for all to complete or will then timeout without waiting. |
void |
registerForShutdown(ShutdownListener shutdownListener)
register to have the listener's shutdown method called at system shutdown
NOTE: no shutdown order is guaranteed.
|
void |
registerToBeShutdownAsLast(ShutdownListener shutdownListener)
register to have the listener's shutdown method called at system shutdown
as one of the last listeners.
|
void |
shutdown()
Calls
ShutdownListener.shutdown() for each registered listener
synchronously in turn. |
void |
unregister(ShutdownListener shutdownListener) |
public void registerForShutdown(ShutdownListener shutdownListener)
shutdownListener - ShutdownListenerpublic void registerToBeShutdownAsLast(ShutdownListener shutdownListener)
registerForShutdown(ShutdownListener).
NOTE: Listeners who manage some executor service should use this method.shutdownListener - ShutdownListenerpublic void prepareForShutdown()
ShutdownListener.prepareForShutdown() for each registered listener
asynchronously, and waiting a total of five seconds for all to complete or will then timeout without waiting.public void shutdown()
ShutdownListener.shutdown() for each registered listener
synchronously in turn.public void unregister(ShutdownListener shutdownListener)
Copyright © 2021. All rights reserved.