public final class ExecutorServiceFactories extends Object
ExecutorServiceFactory
.Modifier and Type | Method and Description |
---|---|
static ExecutorServiceFactory |
cachedThreadPool(String name)
Returns a
ExecutorServiceFactory which creates threadpool executors with the given base
name. |
static ExecutorServiceFactory |
constantExecutorServiceFactory(ExecutorService executorService) |
static ExecutorServiceFactory |
fixedThreadPool(String name,
int nThreads)
Returns a
ExecutorServiceFactory which creates threadpool executors with the given base
name and number of threads. |
public static ExecutorServiceFactory cachedThreadPool(String name)
ExecutorServiceFactory
which creates threadpool executors with the given base
name. Created threads will be daemonic.name
- the base name for executor thread namesExecutorServiceFactory
public static ExecutorServiceFactory fixedThreadPool(String name, int nThreads)
ExecutorServiceFactory
which creates threadpool executors with the given base
name and number of threads. Created threads will be daemonic.name
- the base name for executor thread namesnThreads
- the number of threads to create executors withExecutorServiceFactory
public static ExecutorServiceFactory constantExecutorServiceFactory(ExecutorService executorService)
executorService
- the executor service to supplyExecutorServiceFactory
which always returns the given
ExecutorService
Copyright © 2023. All Rights Reserved.