public final class ThreadPoolExecutors extends Object
| 限定符和类型 | 类和说明 |
|---|---|
static class |
ThreadPoolExecutors.Builder |
static class |
ThreadPoolExecutors.PrestartCoreThreadType |
| 限定符和类型 | 字段和说明 |
|---|---|
static RejectedExecutionHandler |
ABORT
abort and throw RejectedExecutionException
|
static RejectedExecutionHandler |
ALWAYS_CALLER_RUNS
anyway always run
|
static RejectedExecutionHandler |
CALLER_BLOCKS
if not shutdown then put queue until enqueue
|
static RejectedExecutionHandler |
CALLER_RUNS
if not shutdown then run
|
static RejectedExecutionHandler |
DISCARD
discard the task
|
static RejectedExecutionHandler |
DISCARD_OLDEST
if not shutdown then discard oldest and execute the new
|
static int |
MAX_CAP |
| 构造器和说明 |
|---|
ThreadPoolExecutors() |
| 限定符和类型 | 方法和说明 |
|---|---|
static ThreadPoolExecutors.Builder |
builder() |
static boolean |
shutdown(ExecutorService executorService)
Shutdown the ExecutorService safe
|
static boolean |
shutdown(ExecutorService executorService,
int awaitSeconds)
Shutdown the executorService max wait time
|
public static final int MAX_CAP
public static final RejectedExecutionHandler ABORT
public static final RejectedExecutionHandler DISCARD
public static final RejectedExecutionHandler CALLER_RUNS
public static final RejectedExecutionHandler DISCARD_OLDEST
public static final RejectedExecutionHandler CALLER_BLOCKS
public static final RejectedExecutionHandler ALWAYS_CALLER_RUNS
public static ThreadPoolExecutors.Builder builder()
public static boolean shutdown(ExecutorService executorService)
executorService - the executorServicepublic static boolean shutdown(ExecutorService executorService, int awaitSeconds)
executorService - the executorServiceawaitSeconds - await time secondstrue if safe terminateCopyright © 2023. All rights reserved.