Package com.linecorp.armeria.common.util
Class ShutdownHooks
java.lang.Object
com.linecorp.armeria.common.util.ShutdownHooks
A utility class for adding a task with an
AutoCloseable
on shutdown.-
Method Summary
Modifier and TypeMethodDescriptionstatic CompletableFuture<Void>
addClosingTask
(AutoCloseable autoCloseable) Adds anAutoCloseable
to the JVM shutdown hook.static CompletableFuture<Void>
addClosingTask
(AutoCloseable autoCloseable, Runnable whenClosing) Adds anAutoCloseable
and aRunnable
to the JVM shutdown hook.
-
Method Details
-
addClosingTask
Adds anAutoCloseable
to the JVM shutdown hook. -
addClosingTask
public static CompletableFuture<Void> addClosingTask(AutoCloseable autoCloseable, Runnable whenClosing) Adds anAutoCloseable
and aRunnable
to the JVM shutdown hook.
-