public final class ExecutorServiceFactories extends Object
ExecutorServiceFactory
.Modifier and Type | Method and Description |
---|---|
static ExecutorServiceFactory |
constantExecutorServiceFactory(ExecutorService executorService) |
static ExecutorServiceFactory |
fixedThreadPoolExecutorServiceFactory(String name,
int nThreads)
Returns a
ExecutorServiceFactory which creates threadpool executors with the given base
name and number of threads. |
public static ExecutorServiceFactory fixedThreadPoolExecutorServiceFactory(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.