private synchronized void doStart() {
        if (!shuttingDown.get()) {
            LOGGER.info("Starting Stroom Lifecycle service");
            try {
                startRemaining = new CountDownLatch(startPending.size());
                startNext();

                // Wait for startup to complete.
                startRemaining.await();

                LOGGER.info("Started Stroom Lifecycle service");
            } catch (final InterruptedException | UncheckedInterruptedException e) {
                LOGGER.info("Interrupted");
                stop();
            }
        }
    }
Called when the application context is destroyed.
stroom-lifecycle/stroom-lifecycle-impl/src/main/java/stroom/lifecycle/impl/LifecycleService.java