Skip to content

Commit

Permalink
Remove old API.
Browse files Browse the repository at this point in the history
  • Loading branch information
Johan Torin committed Nov 16, 2023
1 parent 046ad22 commit db2f52c
Showing 1 changed file with 0 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,6 @@ public final class ApplicationShutdownSupport {

private ApplicationShutdownSupport() {}

/**
* Attempt to add a shutdown hook. If the application is already shutting down, the shutdown hook
* will not be added.
*
* @return true if the shutdown hook is successfully added, false otherwise.
*/
public static boolean addShutdownHook(Thread shutdownHook, String shutdownHookName) {
try {
LOG.info("Adding shutdown hook {}", shutdownHookName);
Runtime.getRuntime().addShutdownHook(shutdownHook);
return true;
} catch (IllegalStateException ignore) {
LOG.info(
"OTP is already shutting down, the shutdown hook {} will not be added",
shutdownHookName
);
return false;
}
}

/**
* Attempt to add a shutdown hook. If the application is already shutting down, the shutdown hook
* will be executed immediately.
Expand Down

0 comments on commit db2f52c

Please sign in to comment.