org.modeshape.common.util
Class ThreadPools
java.lang.Object
org.modeshape.common.util.ThreadPools
- All Implemented Interfaces:
- ThreadPoolFactory
@ThreadSafe
public class ThreadPools
- extends Object
- implements ThreadPoolFactory
A simple ThreadPoolFactory
implementation.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_THREAD_NAME
public static final String DEFAULT_THREAD_NAME
- See Also:
- Constant Field Values
DEFAULT_MAX_THREAD_COUNT
public static final int DEFAULT_MAX_THREAD_COUNT
- See Also:
- Constant Field Values
ThreadPools
public ThreadPools()
ThreadPools
public ThreadPools(int defaultMaxThreads,
String threadFactoryName)
ThreadPools
public ThreadPools(int defaultMaxThreads,
ThreadFactory threadFactory)
getThreadPool
public Executor getThreadPool(String name)
- Description copied from interface:
ThreadPoolFactory
- Obtain a thread pool with the supplied name, or create and return one if no thread pool exists with that name. When
finished with the thread pool, it should be
released
.
- Specified by:
getThreadPool
in interface ThreadPoolFactory
- Parameters:
name
- the name of the thread pool; may not be null
- Returns:
- the thread pool executor; never null
releaseThreadPool
public void releaseThreadPool(Executor pool)
- Description copied from interface:
ThreadPoolFactory
- Signal that the supplied thread pool is no longer needed.
- Specified by:
releaseThreadPool
in interface ThreadPoolFactory
- Parameters:
pool
- the pool that is no longer needed
Copyright © 2008-2012 JBoss, a division of Red Hat. All Rights Reserved.