public class DynamicThreadPoolExecutor extends ExtensibleThreadPoolExecutor implements org.springframework.beans.factory.DisposableBean
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy| 限定符和类型 | 字段和说明 |
|---|---|
boolean |
waitForTasksToCompleteOnShutdown
Wait for tasks to complete on shutdown
|
| 构造器和说明 |
|---|
DynamicThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
TimeUnit unit,
long executeTimeOut,
boolean waitForTasksToCompleteOnShutdown,
long awaitTerminationMillis,
@NonNull BlockingQueue<Runnable> blockingQueue,
@NonNull String threadPoolId,
@NonNull ThreadFactory threadFactory,
@NonNull RejectedExecutionHandler rejectedExecutionHandler)
Creates a new
DynamicThreadPoolExecutor with the given initial parameters. |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
destroy()
Invoked by the containing
BeanFactory on destruction of a bean. |
long |
getAwaitTerminationMillis()
已过时。
|
Long |
getExecuteTimeOut()
已过时。
|
RejectedExecutionHandler |
getRedundancyHandler()
|
AtomicLong |
getRejectCount()
已过时。
|
Long |
getRejectCountNum()
已过时。
|
org.springframework.core.task.TaskDecorator |
getTaskDecorator()
已过时。
|
void |
setExecuteTimeOut(Long executeTimeOut)
已过时。
|
void |
setRedundancyHandler(RejectedExecutionHandler handler)
|
void |
setSupportParam(long awaitTerminationMillis,
boolean waitForTasksToCompleteOnShutdown)
已过时。
|
void |
setTaskDecorator(org.springframework.core.task.TaskDecorator taskDecorator)
已过时。
|
afterExecute, beforeExecute, execute, getRejectedExecutionHandler, getThreadPoolExecutor, newTaskFor, newTaskFor, setRejectedExecutionHandler, shutdown, shutdownNow, terminatedallowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, finalize, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getQueue, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setThreadFactory, toStringinvokeAll, invokeAll, invokeAny, invokeAny, submit, submit, submitclear, getAllPlugins, getExecuteAwarePluginList, getPlugin, getRejectedAwarePluginList, getShutdownAwarePluginList, getTaskAwarePluginList, getThreadPoolId, getThreadPoolPluginManager, isRegistered, register, tryRegister, unregisterempty, getAllPluginRuntimes, getAllPluginsOfType, getPluginOfType, getRuntimepublic boolean waitForTasksToCompleteOnShutdown
public DynamicThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
TimeUnit unit,
long executeTimeOut,
boolean waitForTasksToCompleteOnShutdown,
long awaitTerminationMillis,
@NonNull
@NonNull BlockingQueue<Runnable> blockingQueue,
@NonNull
@NonNull String threadPoolId,
@NonNull
@NonNull ThreadFactory threadFactory,
@NonNull
@NonNull RejectedExecutionHandler rejectedExecutionHandler)
DynamicThreadPoolExecutor with the given initial parameters.threadPoolId - thread-pool idexecuteTimeOut - execute time outwaitForTasksToCompleteOnShutdown - wait for tasks to complete on shutdownawaitTerminationMillis - await termination milliscorePoolSize - the number of threads to keep in the pool, even
if they are idle, unless allowCoreThreadTimeOut is setmaximumPoolSize - the maximum number of threads to allow in the
poolkeepAliveTime - when the number of threads is greater than
the core, this is the maximum time that excess idle threads
will wait for new tasks before terminating.unit - the time unit for the keepAliveTime argumentblockingQueue - the queue to use for holding tasks before they are
executed. This queue will hold only the Runnable
tasks submitted by the execute method.threadFactory - the factory to use when the executor creates a new threadrejectedExecutionHandler - the handler to use when execution is blocked because the thread bounds and queue capacities are reachedIllegalArgumentException - if one of the following holds:corePoolSize < 0keepAliveTime < 0maximumPoolSize <= 0maximumPoolSize < corePoolSizeNullPointerException - if workQueue
or threadFactory or handler is nullpublic void destroy()
BeanFactory on destruction of a bean.destroy 在接口中 org.springframework.beans.factory.DisposableBean@Deprecated public long getAwaitTerminationMillis()
ThreadPoolExecutorShutdownPlugin@Deprecated public void setSupportParam(long awaitTerminationMillis, boolean waitForTasksToCompleteOnShutdown)
ThreadPoolExecutorShutdownPluginawaitTerminationMillis - await termination milliswaitForTasksToCompleteOnShutdown - wait for tasks to complete on shutdown@Deprecated public Long getRejectCountNum()
TaskRejectCountRecordPlugin@Deprecated public AtomicLong getRejectCount()
TaskRejectCountRecordPlugin@Deprecated public Long getExecuteTimeOut()
TaskTimeoutNotifyAlarmPlugin@Deprecated public void setExecuteTimeOut(Long executeTimeOut)
TaskTimeoutNotifyAlarmPluginexecuteTimeOut - execute time out@Deprecated public org.springframework.core.task.TaskDecorator getTaskDecorator()
TaskDecoratorPluginTaskDecorator.@Deprecated public void setTaskDecorator(org.springframework.core.task.TaskDecorator taskDecorator)
TaskDecoratorPluginTaskDecorator.taskDecorator - task decorator@Deprecated public RejectedExecutionHandler getRedundancyHandler()
@Deprecated public void setRedundancyHandler(RejectedExecutionHandler handler)
handler - handlerCopyright © 2022. All rights reserved.