Package io.helidon.common.configurable
Class ThreadPool.RejectionHandler
java.lang.Object
io.helidon.common.configurable.ThreadPool.RejectionHandler
- All Implemented Interfaces:
RejectedExecutionHandler
- Enclosing class:
ThreadPool
A
RejectedExecutionHandler
that supports pool growth by re-attempting to add the
task to the queue. If the queue is actually full, the rejection is counted and an exception
thrown.-
Constructor Summary
ModifierConstructorDescriptionprotected
Creates a new rejection handler that counts rejections when attempting to offer rejected tasks to thread pool executor. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the number of rejections.void
rejectedExecution
(Runnable task, ThreadPoolExecutor executor) protected void
throwException
(ThreadPoolExecutor executor) Throws an exception.
-
Constructor Details
-
RejectionHandler
protected RejectionHandler()Creates a new rejection handler that counts rejections when attempting to offer rejected tasks to thread pool executor.
-
-
Method Details
-
rejectedExecution
- Specified by:
rejectedExecution
in interfaceRejectedExecutionHandler
-
getRejectionCount
public int getRejectionCount()Returns the number of rejections.- Returns:
- the count.
-
throwException
Throws an exception.- Parameters:
executor
- The executor that is rejecting the task.
-