Top Description Inners Fields Constructors Methods
org.glassfish.grizzly.threadpool

public Class FixedThreadPool

extends AbstractThreadPool
Class Inheritance
Known Direct Subclasses
org.glassfish.grizzly.threadpool.QueueLimitedThreadPool
Imports
java.util.concurrent.BlockingQueue, .LinkedTransferQueue, .RejectedExecutionException

Minimalistic fixed thread pool to allow for nice scalability if a good Queue impl is used.
Author
gustav trede

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
protected final BlockingQueue<Runnable>
Inherited from org.glassfish.grizzly.threadpool.AbstractThreadPool:
configDEFAULT_IDLE_THREAD_KEEPALIVE_TIMEOUTDEFAULT_MAX_TASKS_QUEUEDDEFAULT_MAX_THREAD_COUNTDEFAULT_MIN_THREAD_COUNTdelayedQueuemonitoringConfigpoisonrunningstateLocktransactionTimeoutMillisworkers

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
doStartWorker()

Must hold statelock while calling this method.

public void
execute(Runnable command)

Implements java.util.concurrent.Executor.execute.

Executes the given command at some time in the future.

Inherited from org.glassfish.grizzly.threadpool.AbstractThreadPool:
afterExecuteawaitTerminationbeforeExecutecreateJmxManagementObjectdraingetConfiggetDefaultThreadFactorygetMonitoringConfiggetQueuegetQueueSizegetSizeisShutdownisTerminatedonMaxNumberOfThreadsReachedonTaskCancelledonTaskCompletedEventonTaskDequeuedonTaskQueuedonTaskQueueOverflowonWorkerExitonWorkerStartedpoisonAllshutdownshutdownNowstartWorkertoStringuncaughtExceptionvalidateNewPoolSize

Field Detail

workQueueback to summary
protected final BlockingQueue<Runnable> workQueue

Constructor Detail

FixedThreadPoolback to summary
public FixedThreadPool(ThreadPoolConfig config)

Method Detail

doStartWorkerback to summary
private void doStartWorker()

Must hold statelock while calling this method.

executeback to summary
public void execute(Runnable command)

Implements java.util.concurrent.Executor.execute.

Doc from java.util.concurrent.Executor.execute.

Executes the given command at some time in the future. The command may execute in a new thread, in a pooled thread, or in the calling thread, at the discretion of the Executor implementation.

Annotations
@Override
org.glassfish.grizzly.threadpool back to summary

private final Class FixedThreadPool.BasicWorker

extends Worker
Class Inheritance

Field Summary

Inherited from org.glassfish.grizzly.threadpool.AbstractThreadPool.Worker:
ttransactionExpirationTime

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
protected Runnable
Inherited from org.glassfish.grizzly.threadpool.AbstractThreadPool.Worker:
doWorkrun

Constructor Detail

BasicWorkerback to summary
private BasicWorker()

Method Detail

getTaskback to summary
protected Runnable getTask() throws InterruptedException

Implements abstract org.glassfish.grizzly.threadpool.AbstractThreadPool.Worker.getTask.

Annotations
@Override