public static class ThreadPoolExecutor.DiscardOldestPolicy extends Object implements RejectedExecutionHandler
execute
,除非执行程序被关闭,在这种情况下,任务被丢弃。
Constructor and Description |
---|
DiscardOldestPolicy()
为给定的执行者创建一个
DiscardOldestPolicy 。
|
Modifier and Type | Method and Description |
---|---|
void |
rejectedExecution(Runnable r, ThreadPoolExecutor e)
获取并忽略执行者否则将执行的下一个任务,如果一个可以立即可用,然后重试任务r的执行,除非执行程序关闭,否则任务r被替换掉。
|
public void rejectedExecution(Runnable r, ThreadPoolExecutor e)
rejectedExecution
在界面
RejectedExecutionHandler
r
- 请求执行的可运行任务
e
- 执行者尝试执行此任务
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.