Code example for ScheduledThreadPoolExecutor

Methods: shutdownNow

0
    public ScheduledFuture<?> scheduleWithRate(Runnable command, long delayMs, long periodMs) {
        return executor.scheduleAtFixedRate(command, delayMs, periodMs, TimeUnit.MILLISECONDS);
    } 
 
    public void shutdownNow() { 
        executor.shutdownNow();
        logger.info("ShutdownNow scheduler {} with {} threads.", baseThreadName, threadId.get());
    } 
 
    public void shutdown() { 
        executor.shutdown();
        logger.info("Shutdown scheduler {} with {} threads.", baseThreadName, threadId.get());
    } 
}