public interface ThreadPoolRejectionHandler
ThreadPool
.
A ThreadPool
will be unable to execute a task if all its threads are
in use and its queue is full.
The default ThreadPoolRejectionHandler is
ThreadService.CallerRunsRejectionPolicy
, which will execute the task
in the thread that passed it to the pool. We also provide an alternative
handler, ThreadService.AbortRejectionPolicy
, which throws an exception.
Modifier and Type | Method and Description |
---|---|
void |
rejectedExecution(RunnableTask runnable,
ThreadPool threadPool)
Called when a task can not be executed by a
ThreadPool . |
void rejectedExecution(RunnableTask runnable, ThreadPool threadPool) throws APIException
ThreadPool
.runnable
- the task.threadPool
- the thread pool.APIException
- if unable to handle the execution. This would be
regarded as a serious error.Copyright © 2016 Push Technology Ltd. All Rights Reserved.