|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.neo.swarm.util.threads.OswegoThreadPool
Uses Doug Lea's PooledExecutor to handle a threadpool. Pool is highly configurable through the construction of the PooledExecutor. It handles blocking thread states and graceful shutdown.
| Constructor Summary | |
OswegoThreadPool(EDU.oswego.cs.dl.util.concurrent.PooledExecutor pooledExecutor,
int min,
int max)
|
|
| Method Summary | |
void |
execute(java.lang.Runnable unitOfWork)
Execute a Runnable impl using an internal thread |
int |
getMaximumPoolSize()
The max available pool size. |
int |
getMinimumPoolSize()
Minimum available pool size. |
int |
getPoolSize()
Current number of threads in use. |
void |
setMaximumPoolSize(int poolSize)
Set max thread limit, must also support dynamic resizing of the pool. |
void |
setMinimumPoolSize(int poolSize)
Set min thread limit. |
void |
shutdown(int timeout)
Timeout of 0 kills all threads, pending or executing, Greater values will allow the incoming queue to be processed, however blocked threads may cause an issue. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public OswegoThreadPool(EDU.oswego.cs.dl.util.concurrent.PooledExecutor pooledExecutor,
int min,
int max)
| Method Detail |
public void execute(java.lang.Runnable unitOfWork)
throws java.lang.InterruptedException
ThreadPool
execute in interface ThreadPoolunitOfWork -
java.lang.InterruptedExceptionpublic int getMaximumPoolSize()
ThreadPool
getMaximumPoolSize in interface ThreadPoolpublic int getMinimumPoolSize()
ThreadPool
getMinimumPoolSize in interface ThreadPoolpublic int getPoolSize()
ThreadPool
getPoolSize in interface ThreadPoolpublic void setMaximumPoolSize(int poolSize)
ThreadPool
setMaximumPoolSize in interface ThreadPoolpoolSize - public void setMinimumPoolSize(int poolSize)
ThreadPool
setMinimumPoolSize in interface ThreadPoolpoolSize - public void shutdown(int timeout)
ThreadPool
shutdown in interface ThreadPooltimeout -
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||