Most visited

Recently visited

Added in API level 1

RejectedExecutionHandler

public interface RejectedExecutionHandler

java.util.concurrent.RejectedExecutionHandler
Known Indirect Subclasses


ThreadPoolExecutor不能执行的任务处理程序。

Summary

Public methods

abstract void rejectedExecution(Runnable r, ThreadPoolExecutor executor)

execute无法接受任务时,可能由 ThreadPoolExecutor调用的方法。

Public methods

rejectedExecution

Added in API level 1
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

Hooray!