public abstract class AbstractDynamicExecutorSupport extends ThreadPoolExecutor implements org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy| 限定符和类型 | 字段和说明 |
|---|---|
long |
awaitTerminationMillis |
boolean |
waitForTasksToCompleteOnShutdown |
| 构造器和说明 |
|---|
AbstractDynamicExecutorSupport(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
TimeUnit unit,
boolean waitForTasksToCompleteOnShutdown,
long awaitTerminationMillis,
BlockingQueue<Runnable> workQueue,
String threadPoolId,
ThreadFactory threadFactory,
RejectedExecutionHandler handler) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
afterPropertiesSet()
Calls
initialize() after the container applied all property values. |
protected void |
cancelRemainingTask(Runnable task)
Cancel the given remaining task which never commended execution,
as returned from
ExecutorService.shutdownNow(). |
void |
destroy()
Calls
shutdown when the BeanFactory destroys. |
void |
initialize()
Set up the ExecutorService.
|
protected abstract ExecutorService |
initializeExecutor()
Create the target
ExecutorService instance. |
void |
setSupportParam(long awaitTerminationMillis,
boolean waitForTasksToCompleteOnShutdown)
Set support param.
|
void |
shutdownSupport()
Perform a shutdown on the underlying ExecutorService.
|
afterExecute, allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, beforeExecute, execute, finalize, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getQueue, getRejectedExecutionHandler, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, setThreadFactory, shutdown, shutdownNow, terminated, toStringinvokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submitpublic long awaitTerminationMillis
public boolean waitForTasksToCompleteOnShutdown
public AbstractDynamicExecutorSupport(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
TimeUnit unit,
boolean waitForTasksToCompleteOnShutdown,
long awaitTerminationMillis,
BlockingQueue<Runnable> workQueue,
String threadPoolId,
ThreadFactory threadFactory,
RejectedExecutionHandler handler)
protected abstract ExecutorService initializeExecutor()
ExecutorService instance.
Called by afterPropertiesSet.afterPropertiesSet()public void afterPropertiesSet()
initialize() after the container applied all property values.afterPropertiesSet 在接口中 org.springframework.beans.factory.InitializingBeaninitialize()public void destroy()
shutdown when the BeanFactory destroys.
the task executor instance.destroy 在接口中 org.springframework.beans.factory.DisposableBeanThreadPoolExecutor.shutdown()public void initialize()
public void setSupportParam(long awaitTerminationMillis,
boolean waitForTasksToCompleteOnShutdown)
awaitTerminationMillis - waitForTasksToCompleteOnShutdown - public void shutdownSupport()
protected void cancelRemainingTask(Runnable task)
ExecutorService.shutdownNow().task - the task to cancel (typically a RunnableFuture)ThreadPoolExecutor.shutdown(),
Future.cancel(boolean)Copyright © 2022. All rights reserved.