public void stop()

in src/main/java/com/amazonaws/codepipeline/jobworker/JobWorkerDaemon.java [99:115]


    public void stop() throws Exception {
        LOGGER.info("Stopping daemon.");

        this.executorService.shutdown();
        try {
            if (!this.executorService.awaitTermination(1, TimeUnit.MINUTES)) {
                this.executorService.shutdownNow();
                if (!this.executorService.awaitTermination(1, TimeUnit.MINUTES)) {
                    throw new IllegalStateException("Failed graceful shutdown of executor threads");
                }
            }
        } catch (final InterruptedException e) {
            this.executorService.shutdownNow();
            Thread.currentThread().interrupt();
        }
        LOGGER.info("Stopped daemon.");
    }