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
-
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
public RejectionHandler()
-
-
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.
-