@Override public void run() { exit.setInShutdownHook(); stop(); } });
@Override public void run() { systemExit.setInShutdownHook(); if (stopRequestWatcher != null) { stopRequestWatcher.stopWatching(); } // blocks until everything is corrected terminated scheduler.terminate(); } }
@Test public void do_not_exit_if_in_shutdown_hook() { SystemExit systemExit = new SystemExit(); systemExit.setInShutdownHook(); assertThat(systemExit.isInShutdownHook()).isTrue(); systemExit.exit(0); // still there }
@Override public void run() { exit.setInShutdownHook(); stop(); } });