public interface RejectedExecutionHandler
| java.util.concurrent.RejectedExecutionHandler |
| |
ThreadPoolExecutor不能执行的任务处理程序。
公共方法(Public methods) |
|
|---|---|
abstract void |
rejectedExecution(Runnable r, ThreadPoolExecutor executor) 当 |
void rejectedExecution (Runnable r, ThreadPoolExecutor executor)
当execute无法接受任务时,可能由ThreadPoolExecutor调用的方法。 当没有更多的线程或队列时隙可用时,可能会发生这种情况,因为它们的边界会被超出,或者执行器关闭。
在没有其他选择的情况下,该方法可能会抛出一个未选中的 RejectedExecutionException ,该 RejectedExecutionException将被传播给 execute的调用者。
| 参数(Parameters) | |
|---|---|
r |
Runnable: the runnable task requested to be executed |
executor |
ThreadPoolExecutor: the executor attempting to execute this task |
| 抛出异常(Throws) | |
|---|---|
RejectedExecutionException |
if there is no remedy |