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
的Runnable任务要求被执行
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.