private static void waitForStop()

in resume-api/resume-api-file-offset/src/main/java/org/apache/camel/example/resume/file/offset/main/MainApp.java [54:69]


    private static void waitForStop(Main main, CountDownLatch latch) {
        try {
            latch.await();

            main.stop();
            int shutdownWait = 10;
            while (!main.isStopped() && shutdownWait > 0) {
                Thread.sleep(1000);
                shutdownWait--;
            }

            System.exit(0);
        } catch (InterruptedException e) {
            System.exit(1);
        }
    }