Java Thread Executor Create getExecutorService(int poolSize)

Here you can find the source of getExecutorService(int poolSize)

Description

get Executor Service

License

Open Source License

Declaration

public static ExecutorService getExecutorService(int poolSize) 

Method Source Code

    //package com.java2s;
    //License from project: Open Source License 

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

    public class Main {
        public static ExecutorService getExecutorService(int poolSize) {
    final ThreadFactory threadFactory = runnable -> {
        Thread thr = new Thread(runnable);
        thr.setDaemon(false);/*from   w  w w  . j  av  a 2s. c om*/
        return thr;
    };

    return Executors.newFixedThreadPool(poolSize, threadFactory);
}
    }

Related

  1. getExecutor(int numTasks, int maxThreads)
  2. getExecutorService()
  3. getExecutorService()
  4. getExecutorService()
  5. getExecutorService(int maximumPoolSize, int corePoolSize, long keepAliveTime, final String name, RejectedExecutionHandler rejectionPolicy)
  6. getExecutorService(String usage)
  7. getExecutorServiceWithThreadName(final String threadNamePrefix, int threadCount)
  8. getExecutorThreadId(final ExecutorService executor)