@Override protected void run() throws Exception { // prevent launching persisted inputs too early. LOG.debug("Delaying lauching persisted inputs until the node is in RUNNING state."); Uninterruptibles.awaitUninterruptibly(startLatch); if (previousLifecycle.get() == Lifecycle.RUNNING) { LOG.debug("Launching persisted inputs now."); inputRegistry.launchAllPersisted(); } else { LOG.error("Not starting any inputs because lifecycle is: {}", previousLifecycle.get()); } // next, simply block until we are asked to shutdown, even though we are consuming a thread this // way. Uninterruptibles.awaitUninterruptibly(stopLatch); }