public abstract class DtpLifecycleSupport extends ThreadPoolExecutor implements org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
ThreadPoolTaskExecutor.ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy| 限定符和类型 | 字段和说明 |
|---|---|
protected int |
awaitTerminationSeconds
The maximum number of seconds that this executor is supposed to block
on shutdown in order to wait for remaining tasks to complete their execution
before the rest of the container continues to shut down.
|
protected String |
threadPoolName
Uniquely identifies.
|
protected boolean |
waitForTasksToCompleteOnShutdown
Whether to wait for scheduled tasks to complete on shutdown,
not interrupting running tasks and executing all tasks in the queue.
|
| 构造器和说明 |
|---|
DtpLifecycleSupport(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
TimeUnit unit,
BlockingQueue<Runnable> workQueue,
ThreadFactory threadFactory) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
afterPropertiesSet() |
protected void |
cancelRemainingTask(Runnable task)
Cancel the given remaining task which never commended execution,
as returned from
ExecutorService.shutdownNow(). |
void |
destroy()
Calls
internalShutdown when the BeanFactory destroys
the task executor instance. |
String |
getThreadPoolName() |
protected abstract void |
initialize(DtpProperties dtpProperties)
Initialize, do sth.
|
void |
internalShutdown()
Perform a shutdown on the underlying ExecutorService.
|
void |
setAwaitTerminationSeconds(int awaitTerminationSeconds) |
void |
setThreadPoolName(String threadPoolName) |
void |
setWaitForTasksToCompleteOnShutdown(boolean waitForTasksToCompleteOnShutdown) |
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, submitprotected String threadPoolName
protected boolean waitForTasksToCompleteOnShutdown
protected int awaitTerminationSeconds
public DtpLifecycleSupport(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
TimeUnit unit,
BlockingQueue<Runnable> workQueue,
ThreadFactory threadFactory)
public void setWaitForTasksToCompleteOnShutdown(boolean waitForTasksToCompleteOnShutdown)
public void setAwaitTerminationSeconds(int awaitTerminationSeconds)
public void setThreadPoolName(String threadPoolName)
public String getThreadPoolName()
public void afterPropertiesSet()
afterPropertiesSet 在接口中 org.springframework.beans.factory.InitializingBeanpublic void destroy()
internalShutdown when the BeanFactory destroys
the task executor instance.destroy 在接口中 org.springframework.beans.factory.DisposableBeaninternalShutdown()protected abstract void initialize(DtpProperties dtpProperties)
dtpProperties - dtpPropertiespublic void internalShutdown()
protected void cancelRemainingTask(Runnable task)
ExecutorService.shutdownNow().task - the task to cancel (typically a RunnableFuture)ThreadPoolExecutor.shutdown(),
Future.cancel(boolean)Copyright © 2023. All rights reserved.