Package io.helidon.common.configurable
Class ThreadPool.RejectionHandler
- java.lang.Object
-
- io.helidon.common.configurable.ThreadPool.RejectionHandler
-
- All Implemented Interfaces:
RejectedExecutionHandler
- Enclosing class:
- ThreadPool
public static class ThreadPool.RejectionHandler extends Object implements RejectedExecutionHandler
ARejectedExecutionHandlerthat 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
Constructors Constructor Description RejectionHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetRejectionCount()Returns the number of rejections.voidrejectedExecution(Runnable task, ThreadPoolExecutor executor)protected voidthrowException(ThreadPoolExecutor executor)Throws an exception.
-
-
-
Method Detail
-
rejectedExecution
public void rejectedExecution(Runnable task, ThreadPoolExecutor executor)
- Specified by:
rejectedExecutionin interfaceRejectedExecutionHandler
-
getRejectionCount
public int getRejectionCount()
Returns the number of rejections.- Returns:
- the count.
-
throwException
protected void throwException(ThreadPoolExecutor executor)
Throws an exception.- Parameters:
executor- The executor that is rejecting the task.
-
-