Java examples for java.util.concurrent:ScheduledExecutorService
clean Up ScheduledExecutorService
//package com.java2s; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; public class Main { public static void main(String[] argv) throws Exception { cleanUp();/*w w w.j a v a 2 s. c o m*/ } private static ScheduledExecutorService POOL = Executors .newScheduledThreadPool(20); public static void cleanUp() { if (POOL != null && !POOL.isShutdown()) { POOL.shutdownNow(); } } }