java.lang.Object
java.util.concurrent.AbstractExecutorService
org.glassfish.grizzly.threadpool.AbstractThreadPool
org.glassfish.grizzly.threadpool.SyncThreadPool
- All Implemented Interfaces:
Thread.UncaughtExceptionHandler,Executor,ExecutorService,MonitoringAware<ThreadPoolProbe>
ExecutorService implementation, which function the similar way as former Grizzly 1.x Pipeline based thread
pools.
The SyncThreadPool is synchronized similar way as Grizzly 1.x Pipeline, which makes thread pool more
accurate when deciding to create or not additional worker threads.- Author:
- Alexey Stashok
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.glassfish.grizzly.threadpool.AbstractThreadPool
AbstractThreadPool.Worker -
Field Summary
FieldsFields inherited from class org.glassfish.grizzly.threadpool.AbstractThreadPool
config, DEFAULT_IDLE_THREAD_KEEPALIVE_TIMEOUT, DEFAULT_MAX_TASKS_QUEUED, DEFAULT_MAX_THREAD_COUNT, DEFAULT_MIN_THREAD_COUNT, delayedQueue, monitoringConfig, poison, running, stateLock, transactionTimeoutMillis, workers -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected voidMethod is called byAbstractThreadPool.Worker, when it's completingAbstractThreadPool.Worker.run()method execution, which in most cases means, that ThreadPool's thread will be released.protected voidprotected voidstartWorker(AbstractThreadPool.Worker worker) must hold statelock while calling this method.toString()Methods inherited from class org.glassfish.grizzly.threadpool.AbstractThreadPool
afterExecute, awaitTermination, beforeExecute, drain, getConfig, getDefaultThreadFactory, getMonitoringConfig, getQueue, getSize, isShutdown, isTerminated, onMaxNumberOfThreadsReached, onTaskCancelled, onTaskCompletedEvent, onTaskDequeued, onTaskQueued, onTaskQueueOverflow, onWorkerStarted, shutdown, shutdownNow, uncaughtException, validateNewPoolSizeMethods inherited from class java.util.concurrent.AbstractExecutorService
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submit
-
Field Details
-
maxQueuedTasks
protected int maxQueuedTasks
-
-
Constructor Details
-
SyncThreadPool
-
-
Method Details
-
execute
-
startWorker
Description copied from class:AbstractThreadPoolmust hold statelock while calling this method.- Overrides:
startWorkerin classAbstractThreadPool
-
onWorkerExit
Description copied from class:AbstractThreadPoolMethod is called byAbstractThreadPool.Worker, when it's completingAbstractThreadPool.Worker.run()method execution, which in most cases means, that ThreadPool's thread will be released. This method is called fromAbstractThreadPool.Worker's thread.- Overrides:
onWorkerExitin classAbstractThreadPool
-
poisonAll
protected void poisonAll()- Overrides:
poisonAllin classAbstractThreadPool
-
toString
- Overrides:
toStringin classAbstractThreadPool
-