public class SyncThreadPool extends AbstractThreadPool
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.| Modifier and Type | Class and Description |
|---|---|
protected class |
SyncThreadPool.SyncThreadWorker |
AbstractThreadPool.Worker| Modifier and Type | Field and Description |
|---|---|
protected int |
maxQueuedTasks |
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 and Description |
|---|
SyncThreadPool(ThreadPoolConfig config) |
| Modifier and Type | Method and Description |
|---|---|
void |
execute(Runnable task) |
protected void |
onWorkerExit(AbstractThreadPool.Worker worker)
Method is called by
AbstractThreadPool.Worker, when it's completing AbstractThreadPool.Worker.run() method execution, which in most cases
means, that ThreadPool's thread will be released. |
protected void |
poisonAll() |
protected void |
startWorker(AbstractThreadPool.Worker worker)
must hold statelock while calling this method.
|
String |
toString() |
afterExecute, awaitTermination, beforeExecute, drain, getConfig, getDefaultThreadFactory, getMonitoringConfig, getQueue, getSize, isShutdown, isTerminated, onMaxNumberOfThreadsReached, onTaskCancelled, onTaskCompletedEvent, onTaskDequeued, onTaskQueued, onTaskQueueOverflow, onWorkerStarted, shutdown, shutdownNow, uncaughtException, validateNewPoolSizeinvokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submitpublic SyncThreadPool(ThreadPoolConfig config)
public void execute(Runnable task)
protected void startWorker(AbstractThreadPool.Worker worker)
AbstractThreadPoolstartWorker in class AbstractThreadPoolprotected void onWorkerExit(AbstractThreadPool.Worker worker)
AbstractThreadPoolAbstractThreadPool.Worker, when it's completing AbstractThreadPool.Worker.run() method execution, which in most cases
means, that ThreadPool's thread will be released. This method is called from AbstractThreadPool.Worker's thread.onWorkerExit in class AbstractThreadPoolprotected void poisonAll()
poisonAll in class AbstractThreadPoolpublic String toString()
toString in class AbstractThreadPoolCopyright © 2017–2020 Oracle Corporation. All rights reserved.