@Test(timeOut = 5_000L) public void testRefocusNotQueriedIfShuttingDown() throws Exception { try { fixtures.enableLatches() .oneRefocusToRefocusConfigurationWithRepeatInterval(100) .callRealRefocusExtractProcessor() .initializeFixtures(); ConfigurationUpdateManager manager = fixtures.configurationManager(); executor.submit(manager); AppBootstrapLatches.beforeExtractProcessorStarts().await(); fixtures.shutdownHook().shutdown(); AppBootstrapLatches.holdOffBeforeExtractProcessorStarts().countDown(); AppBootstrapLatches.appHasShutdown().await(); verify(fixtures.systemStatus(), times(0)).timer("Refocus", "get-sample." + AppBootstrapFixtures.MOCK_CONNECTOR_NAME); } finally { AppBootstrapLatches.release(); } }
public void shutdown() { executors.forEach(ExecutorService::shutdown); operations.forEach(Runnable::run); isShutdown.set(true); SHUTDOWN_LATCH.countDown(); }
ShutdownHook extends Thread { public void shutdown() { executors.forEach(ExecutorService::shutdown); operations.forEach(Runnable::run); isShutdown.set(true); SHUTDOWN_LATCH.countDown(); } }
ShutdownHook extends Thread { public void shutdown() { executors.forEach(ExecutorService::shutdown); operations.forEach(Runnable::run); isShutdown.set(true); SHUTDOWN_LATCH.countDown(); }  }
ShutdownHook extends Thread { public void shutdown() { executors.forEach(ExecutorService::shutdown); operations.forEach(Runnable::run); isShutdown.set(true); SHUTDOWN_LATCH.countDown(); }  @Override void run(); void shutdown(); void registerExecutor(ExecutorService executor); void registerOperation(Runnable runnable); boolean isShutdown(); void awaitShutdown(); void awaitExecutorsTermination(final long timeoutMillis); static void awaitExecutorTermination(ExecutorService executor, long timeoutMillis); }
ShutdownHook extends Thread { public void shutdown() { executors.forEach(ExecutorService::shutdown); operations.forEach(Runnable::run); isShutdown.set(true); SHUTDOWN_LATCH.countDown(); }  @Override void run(); void shutdown(); void registerExecutor(ExecutorService executor); void registerOperation(Runnable runnable); boolean isShutdown(); void awaitShutdown(); void awaitExecutorsTermination(final long timeoutMillis); static void awaitExecutorTermination(ExecutorService executor, long timeoutMillis);  }