public enum RejectedExecutionHandlerPolicyEnum extends Enum<RejectedExecutionHandlerPolicyEnum>
Enum Constant and Description |
---|
ABORT_POLICY
当线程池的所有线程都已经被占用时抛出
RejectedExecutionException 异常。 |
CALLER_RUNS_POLICY
当线程池的所有线程都已经被占用时,将由原始线程来执行任务(若原始线程已关闭将直接丢弃任务)。
|
DISCARD_OLDEST_POLICY
当线程池的所有线程都已经被占用时,它丢弃最古老的未处理请求,然后重试执行(若执行程序已关闭将直接丢弃任务)。
|
DISCARD_POLICY
当线程池的所有线程都已经被占用时,将悄悄地丢弃被拒绝的任务。
|
Modifier and Type | Method and Description |
---|---|
static RejectedExecutionHandlerPolicyEnum |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static RejectedExecutionHandlerPolicyEnum[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final RejectedExecutionHandlerPolicyEnum ABORT_POLICY
RejectedExecutionException
异常。public static final RejectedExecutionHandlerPolicyEnum CALLER_RUNS_POLICY
public static final RejectedExecutionHandlerPolicyEnum DISCARD_OLDEST_POLICY
public static final RejectedExecutionHandlerPolicyEnum DISCARD_POLICY
public static RejectedExecutionHandlerPolicyEnum[] values()
for (RejectedExecutionHandlerPolicyEnum c : RejectedExecutionHandlerPolicyEnum.values()) System.out.println(c);
public static RejectedExecutionHandlerPolicyEnum 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 nullCopyright © 2022 Pivotal Software, Inc.. All rights reserved.