|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrabbit.util.ThreadPool<T>
public class ThreadPool<T>
This is a thread pool. It uses RestartableThread.
Nested Class Summary | |
---|---|
static class |
ThreadPool.Usage
The current usage of the threadpool |
Constructor Summary | |
---|---|
ThreadPool(RestartableThreadFactory<T> tf,
int limit)
Create a ThreadPool. |
Method Summary | |
---|---|
RestartableThreadFactory |
getFactory()
Get the current factory. |
int |
getLimit()
Get the current limit of concurrent threads. |
T |
getThread()
Get a Thread. |
ThreadPool.Usage |
getUsage()
Get the current usage of this thread pool. |
void |
returnThread(T t)
Return a thread to the pool. |
void |
setFactory(RestartableThreadFactory<T> tf)
Set the factory to use for creating threads. |
void |
setLimit(int limit)
Set the limit. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ThreadPool(RestartableThreadFactory<T> tf, int limit)
tf
- the RestartableThreadFactory that is used as more Threads are needed.limit
- dont create more threads than this.Method Detail |
---|
public void setLimit(int limit)
limit
- the new limit of concurrent threads.public int getLimit()
public T getThread()
public void returnThread(T t)
t
- the thread to return.public void setFactory(RestartableThreadFactory<T> tf)
tf
- the new factory.public RestartableThreadFactory getFactory()
public ThreadPool.Usage getUsage()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |