|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.thread.QueuedThreadPool
public class QueuedThreadPool
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle |
|---|
AbstractLifeCycle.AbstractLifeCycleListener |
| Nested classes/interfaces inherited from interface org.eclipse.jetty.util.thread.ThreadPool |
|---|
ThreadPool.SizedThreadPool |
| Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle |
|---|
LifeCycle.Listener |
| Field Summary |
|---|
| Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle |
|---|
_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING |
| Constructor Summary | |
|---|---|
QueuedThreadPool()
Construct |
|
QueuedThreadPool(java.util.concurrent.BlockingQueue<java.lang.Runnable> jobQ)
Construct |
|
QueuedThreadPool(int maxThreads)
Construct |
|
| Method Summary | |
|---|---|
boolean |
dispatch(java.lang.Runnable job)
|
protected void |
doStart()
|
protected void |
doStop()
|
java.lang.String |
dump()
|
void |
dump(java.lang.Appendable out,
java.lang.String indent)
|
java.lang.String |
dumpThread(long id)
|
void |
execute(java.lang.Runnable job)
|
int |
getIdleThreads()
|
int |
getMaxIdleTimeMs()
Get the maximum thread idle time. |
int |
getMaxQueued()
|
int |
getMaxStopTimeMs()
|
int |
getMaxThreads()
Set the maximum number of threads. |
int |
getMinThreads()
Get the minimum number of threads. |
java.lang.String |
getName()
|
protected java.util.concurrent.BlockingQueue<java.lang.Runnable> |
getQueue()
|
int |
getThreads()
|
int |
getThreadsPriority()
Get the priority of the pool threads. |
boolean |
interruptThread(long id)
|
boolean |
isDaemon()
Delegated to the named or anonymous Pool. |
boolean |
isDetailedDump()
|
boolean |
isLowOnThreads()
|
void |
join()
Blocks until the thread pool is stopped. |
protected java.lang.Thread |
newThread(java.lang.Runnable runnable)
|
protected void |
runJob(java.lang.Runnable job)
Runs the given job in the current thread. |
void |
setDaemon(boolean daemon)
Delegated to the named or anonymous Pool. |
void |
setDetailedDump(boolean detailedDump)
|
void |
setMaxIdleTimeMs(int maxIdleTimeMs)
Set the maximum thread idle time. |
void |
setMaxQueued(int max)
|
void |
setMaxStopTimeMs(int stopTimeMs)
|
void |
setMaxThreads(int maxThreads)
Set the maximum number of threads. |
void |
setMinThreads(int minThreads)
Set the minimum number of threads. |
void |
setName(java.lang.String name)
|
void |
setThreadsPriority(int priority)
Set the priority of the pool threads. |
boolean |
stopThread(long id)
Deprecated. Use interruptThread(long) in preference |
java.lang.String |
toString()
|
| Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle |
|---|
addLifeCycleListener, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public QueuedThreadPool()
public QueuedThreadPool(int maxThreads)
public QueuedThreadPool(java.util.concurrent.BlockingQueue<java.lang.Runnable> jobQ)
| Method Detail |
|---|
protected void doStart()
throws java.lang.Exception
doStart in class AbstractLifeCyclejava.lang.Exception
protected void doStop()
throws java.lang.Exception
doStop in class AbstractLifeCyclejava.lang.Exceptionpublic void setDaemon(boolean daemon)
public void setMaxIdleTimeMs(int maxIdleTimeMs)
maxIdleTimeMs - Max idle time in ms.getMaxIdleTimeMs()public void setMaxStopTimeMs(int stopTimeMs)
stopTimeMs - maximum total time that stop() will wait for threads to die.public void setMaxThreads(int maxThreads)
setMaxThreads in interface ThreadPool.SizedThreadPoolmaxThreads - maximum number of threads.getMaxThreads()public void setMinThreads(int minThreads)
setMinThreads in interface ThreadPool.SizedThreadPoolminThreads - minimum number of threadsgetMinThreads()public void setName(java.lang.String name)
name - Name of the BoundedThreadPool to use when naming Threads.public void setThreadsPriority(int priority)
priority - the new thread priority.public int getMaxQueued()
public void setMaxQueued(int max)
max - job queue sizepublic int getMaxIdleTimeMs()
setMaxIdleTimeMs(int)public int getMaxStopTimeMs()
public int getMaxThreads()
getMaxThreads in interface ThreadPool.SizedThreadPoolsetMaxThreads(int)public int getMinThreads()
getMinThreads in interface ThreadPool.SizedThreadPoolsetMinThreads(int)public java.lang.String getName()
public int getThreadsPriority()
public boolean isDaemon()
public boolean isDetailedDump()
public void setDetailedDump(boolean detailedDump)
public boolean dispatch(java.lang.Runnable job)
dispatch in interface ThreadPoolpublic void execute(java.lang.Runnable job)
execute in interface java.util.concurrent.Executor
public void join()
throws java.lang.InterruptedException
stopped.
join in interface ThreadPooljava.lang.InterruptedExceptionpublic int getThreads()
getThreads in interface ThreadPoolpublic int getIdleThreads()
getIdleThreads in interface ThreadPoolpublic boolean isLowOnThreads()
isLowOnThreads in interface ThreadPoolprotected java.lang.Thread newThread(java.lang.Runnable runnable)
public java.lang.String dump()
dump in interface Dumpable
public void dump(java.lang.Appendable out,
java.lang.String indent)
throws java.io.IOException
dump in interface Dumpablejava.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Objectprotected void runJob(java.lang.Runnable job)
Runs the given job in the current thread.
Subclasses may override to perform pre/post actions before/after the job is run.
job - the job to runprotected java.util.concurrent.BlockingQueue<java.lang.Runnable> getQueue()
@Deprecated public boolean stopThread(long id)
interruptThread(long) in preference
id - The thread ID to stop.
public boolean interruptThread(long id)
id - The thread ID to interrupt.
public java.lang.String dumpThread(long id)
id - The thread ID to interrupt.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||