Java Thread Executor Pool clearPreloadThreads()

Here you can find the source of clearPreloadThreads()

Description

clear Preload Threads

License

LGPL

Declaration

public static void clearPreloadThreads() 

Method Source Code

//package com.java2s;
//License from project: LGPL 

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Main {
    private static ExecutorService executorService = Executors.newCachedThreadPool();

    public static void clearPreloadThreads() {
        executorService.shutdown();//from w  w  w  .  j  a v  a 2  s.c o  m
        executorService = Executors.newCachedThreadPool();
    }
}

Related

  1. createBoundedCachedThreadPool( final int corePoolSize, final int maximumPoolSize, final long keepAliveTime, final TimeUnit timeUnit)
  2. createClientThreadPool(int numThreads, int queueSize)
  3. createPool(int threads, int queueSize)
  4. createPooledExecutorService(int poolSize, final String namePrefix)