org.jboss.cache.util.concurrent
Class BoundedExecutors
java.lang.Object
org.jboss.cache.util.concurrent.BoundedExecutors
public class BoundedExecutors
- extends Object
Similar to JDK Executors
except that the factory methods here allow you to specify the
size of the blocking queue that backs the executor.
- Since:
- 3.0
- Author:
- Manik Surtani (manik AT jboss DOT org)
Method Summary |
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BoundedExecutors
public BoundedExecutors()
newFixedThreadPool
public static ExecutorService newFixedThreadPool(int nThreads,
int boundedQueueSize)
- Creates a thread pool that reuses a fixed set of threads
operating off a shared bounded queue. If any thread
terminates due to a failure during execution prior to shutdown,
a new one will take its place if needed to execute subsequent
tasks.
- Parameters:
nThreads
- the number of threads in the poolboundedQueueSize
- size of the bounded queue
- Returns:
- the newly created thread pool
newFixedThreadPool
public 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.
- Parameters:
nThreads
- the number of threads in the poolthreadFactory
- the factory to use when creating new threadsboundedQueueSize
- size of the bounded queue
- Returns:
- the newly created thread pool
Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.