|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectorg.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.thread.QueuedThreadPool
public class QueuedThreadPool
| 嵌套类摘要 |
|---|
| 从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的嵌套类/接口 |
|---|
AbstractLifeCycle.AbstractLifeCycleListener |
| 从接口 org.eclipse.jetty.util.thread.ThreadPool 继承的嵌套类/接口 |
|---|
ThreadPool.SizedThreadPool |
| 从接口 org.eclipse.jetty.util.component.LifeCycle 继承的嵌套类/接口 |
|---|
LifeCycle.Listener |
| 字段摘要 |
|---|
| 从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的字段 |
|---|
_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING |
| 构造方法摘要 | |
|---|---|
QueuedThreadPool()
Construct |
|
QueuedThreadPool(BlockingQueue<Runnable> jobQ)
Construct |
|
QueuedThreadPool(int maxThreads)
Construct |
|
| 方法摘要 | |
|---|---|
boolean |
dispatch(Runnable job)
|
protected void |
doStart()
|
protected void |
doStop()
|
String |
dump()
|
void |
dump(Appendable out,
String indent)
|
String |
dumpThread(long id)
|
void |
execute(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. |
String |
getName()
|
protected BlockingQueue<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 Thread |
newThread(Runnable runnable)
|
protected void |
runJob(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(String name)
|
void |
setThreadsPriority(int priority)
Set the priority of the pool threads. |
boolean |
stopThread(long id)
已过时。 Use interruptThread(long) in preference |
String |
toString()
|
| 从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的方法 |
|---|
addLifeCycleListener, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| 构造方法详细信息 |
|---|
public QueuedThreadPool()
public QueuedThreadPool(int maxThreads)
public QueuedThreadPool(BlockingQueue<Runnable> jobQ)
| 方法详细信息 |
|---|
protected void doStart()
throws Exception
AbstractLifeCycle 中的 doStartException
protected void doStop()
throws Exception
AbstractLifeCycle 中的 doStopExceptionpublic 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)
ThreadPool.SizedThreadPool 中的 setMaxThreadsmaxThreads - maximum number of threads.getMaxThreads()public void setMinThreads(int minThreads)
ThreadPool.SizedThreadPool 中的 setMinThreadsminThreads - minimum number of threadsgetMinThreads()public void setName(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()
ThreadPool.SizedThreadPool 中的 getMaxThreadssetMaxThreads(int)public int getMinThreads()
ThreadPool.SizedThreadPool 中的 getMinThreadssetMinThreads(int)public String getName()
public int getThreadsPriority()
public boolean isDaemon()
public boolean isDetailedDump()
public void setDetailedDump(boolean detailedDump)
public boolean dispatch(Runnable job)
ThreadPool 中的 dispatchpublic void execute(Runnable job)
Executor 中的 execute
public void join()
throws InterruptedException
stopped.
ThreadPool 中的 joinInterruptedExceptionpublic int getThreads()
ThreadPool 中的 getThreadspublic int getIdleThreads()
ThreadPool 中的 getIdleThreadspublic boolean isLowOnThreads()
ThreadPool 中的 isLowOnThreadsprotected Thread newThread(Runnable runnable)
public String dump()
Dumpable 中的 dump
public void dump(Appendable out,
String indent)
throws IOException
Dumpable 中的 dumpIOExceptionpublic String toString()
Object 中的 toStringprotected void runJob(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 BlockingQueue<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 String dumpThread(long id)
id - The thread ID to interrupt.
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||