@Override public void run() { LOG.info("Process terminanted, will initiate shutdown."); try { Future<Void> fut = daemon.worker.requestShutdown(); fut.get(shutdownGraceMillis, TimeUnit.MILLISECONDS); LOG.info("Process shutdown is complete."); } catch (InterruptedException | ExecutionException | TimeoutException e) { LOG.error("Encountered an error during shutdown.", e); } } });