public void beginShutdown() {
        if (!shutdownExecutor.isShutdown()) {
            shutdownExecutor.submit((Callable<Void>) () -> {
                try {
                    log.info("Stopping REST server");
                    jettyServer.stop();
                    jettyServer.join();
                    log.info("REST server stopped");
                } catch (Exception e) {
                    log.error("Unable to stop REST server", e);
                } finally {
                    try {
                        jettyServer.destroy();
                    } catch (Exception e) {
                        log.error("Unable to destroy REST server", e);
                    }
                    shutdownExecutor.shutdown();
                }
                return null;
            });
        }
    }
Initiate shutdown, but do not wait for it to complete.
trogdor/src/main/java/org/apache/kafka/trogdor/rest/JsonRestServer.java