public interface RejectedExecutionHandler
ThreadPoolExecutor
无法执行的任务的处理程序。
Modifier and Type | Method and Description |
---|---|
void |
rejectedExecution(Runnable r, ThreadPoolExecutor executor)
ThreadPoolExecutor 当execute 无法接受任务时可能调用的方法。
|
void rejectedExecution(Runnable r, ThreadPoolExecutor executor)
ThreadPoolExecutor
当execute
无法接受任务时可能调用的方法。
当没有更多线程或队列插槽可用时,可能会发生这种情况,因为它们的边界将被超出,或者在执行程序关闭时。
在不存在其它替代的,该方法可以抛出取消选中RejectedExecutionException
,其将传播到的呼叫者execute
。
r
- 请求执行的可运行任务
executor
- 执行者尝试执行此任务
RejectedExecutionException
- 如果没有补救措施
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.