public CompletableFuture<Void> closeOnJvmShutdown(Runnable whenClosing) {
        requireNonNull(whenClosing, "whenClosing");
        return ShutdownHooks.addClosingTask(this, whenClosing);
    }
Registers a JVM shutdown hook that closes this {@link Server} when the current JVM terminates.

@param whenClosing the {@link Runnable} will be run before closing this {@link Server}
core/src/main/java/com/linecorp/armeria/server/Server.java