|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ExtendedThreadPool
Thread pool, from which it's possible to gather statistics information, and finer control its execution.
Method Summary | |
---|---|
int |
getActiveCount()
Returns the approximate number of threads that are actively executing tasks. |
long |
getCompletedTaskCount()
Returns the approximate total number of tasks that have completed execution. |
int |
getCorePoolSize()
Returns the core number of threads. |
long |
getKeepAliveTime(TimeUnit unit)
Returns the thread keep-alive time, which is the amount of time which threads in excess of the core pool size may remain idle before being terminated. |
int |
getLargestPoolSize()
Returns the largest number of threads that have ever simultaneously been in the pool. |
int |
getMaximumPoolSize()
Returns the maximum allowed number of threads. |
int |
getMaxQueuedTasksCount()
|
String |
getName()
|
int |
getPoolSize()
Returns the current number of threads in the pool. |
int |
getPriority()
|
Queue<Runnable> |
getQueue()
Returns the task queue used by this executor. |
int |
getQueueSize()
Returns the number of tasks, which are currently waiting in the queue. |
int |
getTaskCount()
Returns the approximate total number of tasks that have been scheduled for execution. |
ThreadFactory |
getThreadFactory()
Returns the thread factory used to create new threads. |
void |
setCorePoolSize(int corePoolSize)
Sets the core number of threads. |
void |
setKeepAliveTime(long time,
TimeUnit unit)
Sets the time limit for which threads may remain idle before being terminated. |
void |
setMaximumPoolSize(int maximumPoolSize)
Sets the maximum allowed number of threads. |
void |
setMaxQueuedTasksCount(int maxTasksCount)
|
void |
setName(String name)
|
void |
setPriority(int priority)
|
void |
setThreadFactory(ThreadFactory threadFactory)
Sets the thread factory used to create new threads. |
Methods inherited from interface java.util.concurrent.ExecutorService |
---|
awaitTermination, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated, shutdown, shutdownNow, submit, submit, submit |
Methods inherited from interface java.util.concurrent.Executor |
---|
execute |
Method Detail |
---|
int getActiveCount()
int getTaskCount()
long getCompletedTaskCount()
int getCorePoolSize()
setCorePoolSize(int)
void setCorePoolSize(int corePoolSize)
corePoolSize
- the new core size
IllegalArgumentException
- if corePoolSize
less than zerogetCorePoolSize()
int getLargestPoolSize()
int getPoolSize()
Queue<Runnable> getQueue()
int getQueueSize()
long getKeepAliveTime(TimeUnit unit)
unit
- the desired time unit of the result
setKeepAliveTime(long, java.util.concurrent.TimeUnit)
void setKeepAliveTime(long time, TimeUnit unit)
time
- the time to wait. A time value of zero will cause
excess threads to terminate immediately after executing tasks.unit
- the time unit of the time argument
IllegalArgumentException
- if time less than zerogetKeepAliveTime(java.util.concurrent.TimeUnit)
int getMaximumPoolSize()
setMaximumPoolSize(int)
void setMaximumPoolSize(int maximumPoolSize)
maximumPoolSize
- the new maximum
IllegalArgumentException
- if maximumPoolSize less than zero or
the core pool size
getMaximumPoolSize()
int getMaxQueuedTasksCount()
void setMaxQueuedTasksCount(int maxTasksCount)
maxTasksCount
- int getPriority()
void setPriority(int priority)
String getName()
void setName(String name)
name
- void setThreadFactory(ThreadFactory threadFactory)
threadFactory
- the new thread factory
NullPointerException
- if threadFactory is nullgetThreadFactory()
ThreadFactory getThreadFactory()
setThreadFactory(java.util.concurrent.ThreadFactory)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |