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
ARejectedExecutionHandler
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
Constructors Constructor Description RejectionHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getRejectionCount()
Returns the number of rejections.void
rejectedExecution(Runnable task, ThreadPoolExecutor executor)
protected void
throwException(ThreadPoolExecutor executor)
Throws an exception.
-
-
-
Method Detail
-
rejectedExecution
public void rejectedExecution(Runnable task, ThreadPoolExecutor executor)
- Specified by:
rejectedExecution
in 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.
-
-