Class WaterMarkExecutor
java.lang.Object
java.util.concurrent.AbstractExecutorService
java.util.concurrent.ThreadPoolExecutor
org.apache.axis2.transport.base.threads.watermark.WaterMarkExecutor
- All Implemented Interfaces:
Executor,ExecutorService
An
ExecutorService that executes each submitted task using
one of possibly several pooled threads, but the execution happens differently
from the ThreadPoolExecutor. In this executor after all the core pool threads
are used queuing happens until the water mark. If the more tasks are submitted after
the queue is filled up to the water mark the number of threads increases to max.
If the number of tasks continue to increase the Queue begins to fill up. If the queue
is a bounded queue and the queue is completely filled a RejectedExecutionHandler
is executed if one specified. Otherwise the task is rejected.-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.concurrent.ThreadPoolExecutor
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy -
Constructor Summary
ConstructorsConstructorDescriptionWaterMarkExecutor(int core, int max, long keepAlive, TimeUnit timeUnit, WaterMarkQueue<Runnable> queue) WaterMarkExecutor(int core, int max, long keepAlive, TimeUnit timeUnit, WaterMarkQueue<Runnable> queue, RejectedExecutionHandler rejectedExecutionHandler) WaterMarkExecutor(int core, int max, long keepAlive, TimeUnit timeUnit, WaterMarkQueue<Runnable> queue, ThreadFactory threadFactory) WaterMarkExecutor(int core, int max, long keepAlive, TimeUnit timeUnit, WaterMarkQueue<Runnable> queue, ThreadFactory threadFactory, RejectedExecutionHandler rejectedExecutionHandler) -
Method Summary
Methods inherited from class java.util.concurrent.ThreadPoolExecutor
afterExecute, allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, beforeExecute, execute, 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, toStringMethods inherited from class java.util.concurrent.AbstractExecutorService
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submit
-
Constructor Details
-
WaterMarkExecutor
public WaterMarkExecutor(int core, int max, long keepAlive, TimeUnit timeUnit, WaterMarkQueue<Runnable> queue) -
WaterMarkExecutor
public WaterMarkExecutor(int core, int max, long keepAlive, TimeUnit timeUnit, WaterMarkQueue<Runnable> queue, ThreadFactory threadFactory) -
WaterMarkExecutor
public WaterMarkExecutor(int core, int max, long keepAlive, TimeUnit timeUnit, WaterMarkQueue<Runnable> queue, RejectedExecutionHandler rejectedExecutionHandler) -
WaterMarkExecutor
public WaterMarkExecutor(int core, int max, long keepAlive, TimeUnit timeUnit, WaterMarkQueue<Runnable> queue, ThreadFactory threadFactory, RejectedExecutionHandler rejectedExecutionHandler)
-