|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.concurrent.AbstractExecutorService
java.util.concurrent.ThreadPoolExecutor
org.mortbay.thread.concurrent.ThreadPool
public class ThreadPool
Jetty ThreadPool using java 5 ThreadPoolExecutor
This class wraps a ThreadPoolExecutor with the ThreadPool and
LifeCycle interfaces so that it may be used by the Jetty Server
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.util.concurrent.ThreadPoolExecutor |
|---|
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy |
| Constructor Summary | |
|---|---|
ThreadPool()
Default constructor. |
|
ThreadPool(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
TimeUnit unit)
Size constructor. |
|
ThreadPool(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
TimeUnit unit,
BlockingQueue<Runnable> workQueue)
|
|
ThreadPool(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
TimeUnit unit,
BlockingQueue<Runnable> workQueue,
RejectedExecutionHandler handler)
|
|
ThreadPool(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
TimeUnit unit,
BlockingQueue<Runnable> workQueue,
ThreadFactory threadFactory)
|
|
ThreadPool(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
TimeUnit unit,
BlockingQueue<Runnable> workQueue,
ThreadFactory threadFactory,
RejectedExecutionHandler handler)
|
|
| Method Summary | |
|---|---|
boolean |
dispatch(Runnable job)
|
int |
getIdleThreads()
|
int |
getThreads()
|
boolean |
isFailed()
|
boolean |
isLowOnThreads()
|
boolean |
isRunning()
|
boolean |
isStarted()
|
boolean |
isStarting()
|
boolean |
isStopped()
|
boolean |
isStopping()
|
void |
join()
Blocks until the thread pool is stopped. |
void |
start()
Starts the component. |
void |
stop()
Stops the component. |
| Methods inherited from class java.util.concurrent.AbstractExecutorService |
|---|
invokeAll, invokeAll, invokeAny, invokeAny, submit, submit, submit |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ThreadPool()
LinkedBlockingQueue is used for the job queue;
public ThreadPool(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
TimeUnit unit)
LinkedBlockingQueue is used for the jobs queue;
public ThreadPool(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
TimeUnit unit,
BlockingQueue<Runnable> workQueue)
public ThreadPool(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
TimeUnit unit,
BlockingQueue<Runnable> workQueue,
RejectedExecutionHandler handler)
public ThreadPool(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
TimeUnit unit,
BlockingQueue<Runnable> workQueue,
ThreadFactory threadFactory,
RejectedExecutionHandler handler)
public ThreadPool(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
TimeUnit unit,
BlockingQueue<Runnable> workQueue,
ThreadFactory threadFactory)
| Method Detail |
|---|
public boolean dispatch(Runnable job)
dispatch in interface ThreadPoolpublic int getIdleThreads()
getIdleThreads in interface ThreadPoolpublic int getThreads()
getThreads in interface ThreadPoolpublic boolean isLowOnThreads()
isLowOnThreads in interface ThreadPool
public void join()
throws InterruptedException
ThreadPoolstopped.
join in interface ThreadPoolInterruptedExceptionpublic boolean isFailed()
isFailed in interface LifeCyclepublic boolean isRunning()
isRunning in interface LifeCyclepublic boolean isStarted()
isStarted in interface LifeCycleLifeCycle.start(),
LifeCycle.isStarting()public boolean isStarting()
isStarting in interface LifeCycleLifeCycle.isStarted()public boolean isStopped()
isStopped in interface LifeCycleLifeCycle.stop(),
LifeCycle.isStopping()public boolean isStopping()
isStopping in interface LifeCycleLifeCycle.isStopped()
public void start()
throws Exception
LifeCycle
start in interface LifeCycleException - If the component fails to startLifeCycle.isStarted(),
LifeCycle.stop(),
LifeCycle.isFailed()
public void stop()
throws Exception
LifeCycle
stop in interface LifeCycleException - If the component fails to stopLifeCycle.isStopped(),
LifeCycle.start(),
LifeCycle.isFailed()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||