public class DefaultExecutorProvider extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.util.concurrent.ExecutorService |
globalExecutor
全局线程池(自动退出封装)
|
protected java.util.concurrent.ScheduledExecutorService |
timerExecutor
定时任务线程池对象(自动退出封装)
|
Modifier | Constructor and Description |
---|---|
protected |
DefaultExecutorProvider() |
Modifier and Type | Method and Description |
---|---|
protected static java.util.concurrent.ExecutorService |
createCachedPool(java.lang.Integer corePoolSize,
java.lang.Integer maximumPoolSize,
java.lang.Long keepAliveTime,
java.lang.Integer queueCapacity,
java.lang.String nameFormat)
根据配置文件指定的参数创建通用任务线程池对象
|
protected java.util.concurrent.ExecutorService |
createExitingCachedPool()
创建一个自动退出封装的全局线程池,
子类可以使用不同的参数调用
createCachedPool(Integer, Integer, Long, Integer, String) 重写此方法 |
protected java.util.concurrent.ScheduledExecutorService |
createExitingScheduledPool()
创建一个自动退出封装的定时任务线程池,
子类可以使用不同的参数调用
createScheduledPool(Integer, String) 重写此方法 |
protected static java.util.concurrent.ScheduledExecutorService |
createScheduledPool(java.lang.Integer corePoolSize,
java.lang.String nameFormat)
根据配置文件指定的参数创建定时任务线程池对象
|
static java.util.concurrent.ExecutorService |
getGlobalExceutor()
返回全局线程池
|
static java.util.concurrent.ScheduledExecutorService |
getTimerExecutor()
返回定时任务线程池
|
protected final java.util.concurrent.ExecutorService globalExecutor
protected final java.util.concurrent.ScheduledExecutorService timerExecutor
protected DefaultExecutorProvider()
protected static final java.util.concurrent.ExecutorService createCachedPool(java.lang.Integer corePoolSize, java.lang.Integer maximumPoolSize, java.lang.Long keepAliveTime, java.lang.Integer queueCapacity, java.lang.String nameFormat)
protected static final java.util.concurrent.ScheduledExecutorService createScheduledPool(java.lang.Integer corePoolSize, java.lang.String nameFormat)
protected java.util.concurrent.ExecutorService createExitingCachedPool()
createCachedPool(Integer, Integer, Long, Integer, String)
重写此方法protected java.util.concurrent.ScheduledExecutorService createExitingScheduledPool()
createScheduledPool(Integer, String)
重写此方法public static java.util.concurrent.ExecutorService getGlobalExceutor()
public static java.util.concurrent.ScheduledExecutorService getTimerExecutor()
Copyright © 2019. All rights reserved.