public final class ShutdownHookManager
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
void |
addShutdownHook(java.lang.Runnable shutdownHook)
Adds a shutdownHook with default priority zero, the higher the priority
the earlier will run.
|
void |
addShutdownHook(java.lang.Runnable shutdownHook,
int priority)
Adds a shutdownHook with a priority, the higher the priority
the earlier will run.
|
void |
clearShutdownHooks()
clear all registered shutdownHooks.
|
static ShutdownHookManager |
get()
Return
ShutdownHookManager singleton. |
boolean |
hasShutdownHook(java.lang.Runnable shutdownHook)
Indicates if a shutdownHook is registered or not.
|
boolean |
isShutdownInProgress()
Indicates if shutdown is in progress or not.
|
boolean |
removeShutdownHook(java.lang.Runnable shutdownHook)
Removes a shutdownHook.
|
public static ShutdownHookManager get()
ShutdownHookManager singleton.ShutdownHookManager singleton.public void addShutdownHook(java.lang.Runnable shutdownHook)
shutdownHook - shutdownHook Runnablepublic void addShutdownHook(java.lang.Runnable shutdownHook,
int priority)
shutdownHook - shutdownHook Runnablepriority - priority of the shutdownHook.public boolean removeShutdownHook(java.lang.Runnable shutdownHook)
shutdownHook - shutdownHook to remove.public boolean hasShutdownHook(java.lang.Runnable shutdownHook)
shutdownHook - shutdownHook to check if registered.public boolean isShutdownInProgress()
public void clearShutdownHooks()
Copyright © 2023 The Apache Software Foundation. All rights reserved.