Code example for ScheduledThreadPoolExecutor

Methods: setRemoveOnCancelPolicy

0
        return JBossExecutors.protectedScheduledExecutorService(this.executor);
    } 
 
    @Override 
    public void start(StartContext context) {
        ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(this.size, this.threadFactory);
        executor.setRemoveOnCancelPolicy(true);
        this.executor = executor;
    } 
 
    @Override 
    public void stop(StopContext context) {
        this.executor.shutdownNow();
    } 
} 
Connect your IDE to all the code out there  Get Codota for Java