private static class TransportFilter.QueuingExecutor
extends java.util.concurrent.ThreadPoolExecutor
Modifier and Type | Class and Description |
---|---|
private static class |
TransportFilter.QueuingExecutor.HandOffQueue
Synchronous queue that tries to empty
TransportFilter.QueuingExecutor.HandOffQueue.taskQueue before it blocks waiting for new tasks to be submitted. |
java.util.concurrent.ThreadPoolExecutor.AbortPolicy, java.util.concurrent.ThreadPoolExecutor.CallerRunsPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardOldestPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardPolicy
Modifier and Type | Field and Description |
---|---|
private java.util.Queue<java.lang.Runnable> |
taskQueue |
private boolean |
threadSafeQueue |
Constructor and Description |
---|
QueuingExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
java.util.concurrent.TimeUnit unit,
java.util.Queue<java.lang.Runnable> taskQueue,
boolean threadSafeQueue,
java.util.concurrent.ThreadFactory threadFactory)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
execute(java.lang.Runnable task)
Submit a task for execution, if the maximum thread limit has been reached and all the threads are occupied,
enqueue the task.
|
afterExecute, allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, beforeExecute, finalize, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getQueue, getRejectedExecutionHandler, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, setThreadFactory, shutdown, shutdownNow, terminated, toString
private final java.util.Queue<java.lang.Runnable> taskQueue
private final boolean threadSafeQueue
QueuingExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, java.util.concurrent.TimeUnit unit, java.util.Queue<java.lang.Runnable> taskQueue, boolean threadSafeQueue, java.util.concurrent.ThreadFactory threadFactory)
threadSafeQueue
- indicates if taskQueue
is thread safe or not.public void execute(java.lang.Runnable task)
execute
in interface java.util.concurrent.Executor
execute
in class java.util.concurrent.ThreadPoolExecutor
task
- to be executed.