public interface RejectedTaskHandler
LimitingTaskExecutor
.Modifier and Type | Method and Description |
---|---|
void |
rejectedExecution(Runnable r,
LimitingTaskExecutor executor)
Method that may be invoked by a
LimitingTaskExecutor when
execute cannot accept a task. |
void rejectedExecution(Runnable r, LimitingTaskExecutor executor)
LimitingTaskExecutor
when
execute
cannot accept a task. This may occur when the max
allowed tasks have already been submitted to the underlying ExecutorService and no queue slots are
available because its bounds would be exceeded, if the underlying ExecutorService has rejected this
task and it cannot be queued because the queue is full or there are no active tasks running to
process queued tasks after their completion, or upon shutdown of the Executor.
In the absence of other alternatives, the method may throw
an unchecked RejectedExecutionException
, which will be
propagated to the caller of execute
.
r
- the runnable task requested to be executedexecutor
- the executor attempting to execute this taskRejectedExecutionException
- if there is no remedyCopyright © 2013- Suresh Mahalingam. All Rights Reserved.