public class BoundedExecutors extends Object
Executors
except that the factory methods here allow you to specify the
size of the blocking queue that backs the executor.Constructor and Description |
---|
BoundedExecutors() |
Modifier and Type | Method and Description |
---|---|
static ExecutorService |
newFixedThreadPool(int nThreads,
int boundedQueueSize)
Creates a thread pool that reuses a fixed set of threads operating off a shared bounded queue.
|
static ExecutorService |
newFixedThreadPool(int nThreads,
ThreadFactory threadFactory,
int boundedQueueSize)
Creates a thread pool that reuses a fixed set of threads operating off a shared bounded queue, using the provided
ThreadFactory to create new threads when needed.
|
public static ExecutorService newFixedThreadPool(int nThreads, int boundedQueueSize)
nThreads
- the number of threads in the poolboundedQueueSize
- size of the bounded queuepublic static ExecutorService newFixedThreadPool(int nThreads, ThreadFactory threadFactory, int boundedQueueSize)
nThreads
- the number of threads in the poolthreadFactory
- the factory to use when creating new threadsboundedQueueSize
- size of the bounded queueCopyright © 2021 JBoss by Red Hat. All rights reserved.