public class ThreadPoolExecutorShutdownPlugin extends Object implements ShutdownAwarePlugin
After the thread pool calls ThreadPoolExecutor.shutdown() or ThreadPoolExecutor.shutdownNow().
Cancel the remaining tasks in the pool, then wait for the thread pool to terminate until
the blocked main thread has timed out or the thread pool has completely terminated.
| 限定符和类型 | 字段和说明 |
|---|---|
long |
awaitTerminationMillis
Await termination millis
|
static String |
PLUGIN_NAME |
| 构造器和说明 |
|---|
ThreadPoolExecutorShutdownPlugin() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
afterShutdown(ThreadPoolExecutor executor,
List<Runnable> remainingTasks)
Callback after pool shutdown.
|
void |
beforeShutdown(ThreadPoolExecutor executor)
Callback before pool shutdown.
|
protected void |
cancelRemainingTask(Runnable task)
Cancel the given remaining task which never commended execution,
as returned from
ExecutorService.shutdownNow(). |
String |
getId()
Get id.
|
PluginRuntime |
getPluginRuntime()
Get plugin runtime info.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitafterTerminatedstart, stoppublic String getId()
getId 在接口中 ThreadPoolPluginpublic void beforeShutdown(ThreadPoolExecutor executor)
beforeShutdown 在接口中 ShutdownAwarePluginexecutor - executorThreadPoolExecutor.shutdown(),
ThreadPoolExecutor.shutdownNow()public void afterShutdown(ThreadPoolExecutor executor, List<Runnable> remainingTasks)
awaitTerminationMillis if necessary.afterShutdown 在接口中 ShutdownAwarePluginexecutor - executorremainingTasks - remainingTasksThreadPoolExecutor.shutdown(),
ThreadPoolExecutor.shutdownNow()public PluginRuntime getPluginRuntime()
getPluginRuntime 在接口中 ThreadPoolPluginprotected void cancelRemainingTask(Runnable task)
ExecutorService.shutdownNow().task - the task to cancel (typically a RunnableFuture)Future.cancel(boolean)Copyright © 2022. All rights reserved.