List of usage examples for com.google.common.util.concurrent ListeningScheduledExecutorService shutdown
void shutdown();
From source file:org.apache.bookkeeper.stream.common.Scheduler.java
/** * Shutdown the scheduler//w w w . j a v a 2s. c o m */ public void shutdown() { for (ListeningScheduledExecutorService executor : executors) { executor.shutdown(); } }
From source file:com.github.rinde.rinsim.core.model.time.RealtimeModel.java
void shutdownExecutor() { LOGGER.trace("Shutting down executor.."); final ListeningScheduledExecutorService ex = realtimeState.executor; if (ex != null) { ex.shutdown(); // in case the future could not be cancelled before, do it now final ListenableScheduledFuture<?> fut = realtimeState.schedulerFuture; if (fut != null && !fut.isDone()) { realtimeState.cancelTask();/*w w w.j a v a 2 s . com*/ } try { ex.awaitTermination(Long.MAX_VALUE, TimeUnit.DAYS); } catch (final InterruptedException e) { throw new IllegalStateException(e); } LOGGER.trace("Executor shutdown."); } verifyNotNull(affinityLock).release(); }