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 |
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private int | |
| protected int | |
| private final Queue |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | execute(Runnable task)
Implements java. Executes the given command at some time in the future. |
| protected void | onWorkerExit(AbstractThreadPool.
Overrides org. Method is called by |
| protected void | |
| protected void | startWorker(AbstractThreadPool.
Overrides org. must hold statelock while calling this method. |
| public String | toString()
Overrides org. Returns a string representation of the object. |
| activeThreadsCount | back to summary |
|---|---|
| private int activeThreadsCount | |
| currentPoolSize | back to summary |
|---|---|
| private int currentPoolSize | |
| maxQueuedTasks | back to summary |
|---|---|
| protected int maxQueuedTasks | |
| workQueue | back to summary |
|---|---|
| private final Queue<Runnable> workQueue | |
| SyncThreadPool | back to summary |
|---|---|
| public SyncThreadPool(ThreadPoolConfig config) | |
| execute | back to summary |
|---|---|
| public void execute(Runnable task) Implements java. Doc from java. 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
| |
| onWorkerExit | back to summary |
|---|---|
| protected void onWorkerExit(AbstractThreadPool. Overrides org. Doc from org. Method is called by
| |
| poisonAll | back to summary |
|---|---|
| protected void poisonAll() Overrides org.
| |
| startWorker | back to summary |
|---|---|
| protected void startWorker(AbstractThreadPool. Overrides org. Doc from org. must hold statelock while calling this method.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides org. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |
| Modifier and Type | Field and Description |
|---|---|
| private final boolean |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected Runnable |
| core | back to summary |
|---|---|
| private final boolean core | |
| SyncThreadWorker | back to summary |
|---|---|
| public SyncThreadWorker(boolean core) | |
| getTask | back to summary |
|---|---|
| protected Runnable getTask() throws InterruptedException Implements abstract org.
| |