public enum RejectPolicy extends Enum<RejectPolicy>
Enum Constant and Description |
---|
ABORT
任务遭到拒绝将抛出异常
|
CALLER_RUNS
由调用线程执行任务
|
DISCARD
放弃当前任务 静默抛出
|
DISCARD_OLDEST
删除工作队列头部任务进行重试, 如果失败则重复操作
|
Modifier and Type | Method and Description |
---|---|
RejectedExecutionHandler |
getHandler() |
static RejectPolicy |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static RejectPolicy[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final RejectPolicy ABORT
public static final RejectPolicy DISCARD
public static final RejectPolicy DISCARD_OLDEST
public static final RejectPolicy CALLER_RUNS
public static RejectPolicy[] values()
for (RejectPolicy c : RejectPolicy.values()) System.out.println(c);
public static RejectPolicy valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic RejectedExecutionHandler getHandler()
Copyright © 2024. All rights reserved.