clean Up ScheduledExecutorService - Java java.util.concurrent

Java examples for java.util.concurrent:ScheduledExecutorService

Description

clean Up ScheduledExecutorService

Demo Code


//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();

        }

    }
}

Related Tutorials