|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.concurrent.AbstractExecutorService
com.sun.grizzly.util.AbstractThreadPool
com.sun.grizzly.util.FixedThreadPool
public class FixedThreadPool
minimalistic fixed threadpool to allow for nice scalability if a
good Queue impl is used.
by default: WorkerThreadImpl is used,
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.sun.grizzly.util.AbstractThreadPool |
|---|
AbstractThreadPool.Worker |
| Field Summary | |
|---|---|
protected BlockingQueue<Runnable> |
workQueue
|
| Fields inherited from class com.sun.grizzly.util.AbstractThreadPool |
|---|
activeThreadsCount, byteBufferType, corePoolSize, currentPoolSize, DEFAULT_IDLE_THREAD_KEEPALIVE_TIMEOUT, DEFAULT_MAX_TASKS_QUEUED, DEFAULT_MAX_THREAD_COUNT, DEFAULT_MIN_THREAD_COUNT, initialByteBufferSize, keepAliveTime, maxPoolSize, name, poison, priority, probe, running, statelock, threadFactory, workers |
| Constructor Summary | |
|---|---|
FixedThreadPool()
creates a fixed pool of size 8 |
|
FixedThreadPool(int size)
|
|
FixedThreadPool(int poolsize,
BlockingQueue<Runnable> workQueue,
ThreadFactory threadfactory)
|
|
FixedThreadPool(int poolsize,
String name)
|
|
FixedThreadPool(int poolsize,
ThreadFactory threadfactory)
|
|
FixedThreadPool(String name,
int poolsize,
BlockingQueue<Runnable> workQueue,
ThreadFactory threadfactory)
|
|
FixedThreadPool(String name,
int poolsize,
BlockingQueue<Runnable> workQueue,
ThreadFactory threadfactory,
ThreadPoolMonitoringProbe probe)
|
|
| Method Summary | |
|---|---|
boolean |
awaitTermination(long timeout,
TimeUnit unit)
not supported |
void |
execute(Runnable command)
|
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 |
getLargestPoolSize()
Returns the largest number of threads that have ever simultaneously been in the pool. |
int |
getMaxQueuedTasksCount()
|
int |
getPoolSize()
Returns the current number of threads in the pool. |
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. |
boolean |
isTerminated()
not supported |
void |
setCorePoolSize(int corePoolSize)
Sets the core number of threads. |
void |
setMaximumPoolSize(int maximumPoolSize)
Sets the maximum allowed number of threads. |
void |
setMaxQueuedTasksCount(int maxTasksCount)
|
| Methods inherited from class java.util.concurrent.AbstractExecutorService |
|---|
invokeAll, invokeAll, invokeAny, invokeAny, submit, submit, submit |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.concurrent.ExecutorService |
|---|
invokeAll, invokeAll, invokeAny, invokeAny, submit, submit, submit |
| Field Detail |
|---|
protected final BlockingQueue<Runnable> workQueue
| Constructor Detail |
|---|
public FixedThreadPool()
public FixedThreadPool(int size)
size -
public FixedThreadPool(int poolsize,
String name)
poolsize - name -
public FixedThreadPool(int poolsize,
ThreadFactory threadfactory)
poolsize - threadfactory -
public FixedThreadPool(int poolsize,
BlockingQueue<Runnable> workQueue,
ThreadFactory threadfactory)
poolsize - workQueue - threadfactory -
public FixedThreadPool(String name,
int poolsize,
BlockingQueue<Runnable> workQueue,
ThreadFactory threadfactory)
name - poolsize - workQueue - threadfactory -
public FixedThreadPool(String name,
int poolsize,
BlockingQueue<Runnable> workQueue,
ThreadFactory threadfactory,
ThreadPoolMonitoringProbe probe)
name - poolsize - workQueue - threadfactory - probe - | Method Detail |
|---|
public final void setMaximumPoolSize(int maximumPoolSize)
AbstractThreadPool
setMaximumPoolSize in interface ExtendedThreadPoolsetMaximumPoolSize in class AbstractThreadPoolmaximumPoolSize - the new maximumExtendedThreadPool.getMaximumPoolSize()public void execute(Runnable command)
public boolean isTerminated()
public boolean awaitTermination(long timeout,
TimeUnit unit)
throws InterruptedException
InterruptedExceptionpublic int getActiveCount()
ExtendedThreadPool
public int getTaskCount()
ExtendedThreadPool
public long getCompletedTaskCount()
ExtendedThreadPool
public void setCorePoolSize(int corePoolSize)
AbstractThreadPool
setCorePoolSize in interface ExtendedThreadPoolsetCorePoolSize in class AbstractThreadPoolcorePoolSize - the new core sizeExtendedThreadPool.getCorePoolSize()public int getLargestPoolSize()
ExtendedThreadPool
public int getPoolSize()
ExtendedThreadPool
public Queue<Runnable> getQueue()
ExtendedThreadPool
public int getQueueSize()
ExtendedThreadPool
public int getMaxQueuedTasksCount()
public void setMaxQueuedTasksCount(int maxTasksCount)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||