程序包 cn.godmao.utils
类 ExecutorUtil
java.lang.Object
cn.godmao.utils.ExecutorUtil
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static ThreadFactorycreateThreadFactory(String namePrefix) 创建 线程工厂static ThreadFactorycreateThreadFactory(String namePrefix, boolean daemon) 创建线程工厂static ExecutorServicenewCacheThreadPool(String namePrefix) 创建线程池static ExecutorServicenewCacheThreadPool(ThreadFactory threadFactory) 线程池static ExecutorServicenewFixedThreadPool(int corePoolSize, String namePrefix) 创建固定大小线程执行器static ExecutorServicenewFixedThreadPool(int corePoolSize, ThreadFactory threadFactory) 创建固定大小线程执行器static ScheduledExecutorServicenewScheduled(int corePoolSize, String namePrefix) 创建指定数量 - 的线程调度执行器static ScheduledExecutorServicenewScheduled(int corePoolSize, ThreadFactory threadFactory) 创建指定数量 - 的线程调度执行器static ScheduledExecutorServicenewSingleScheduled(String namePrefix) 创建单个线程调度执行器static ScheduledExecutorServicenewSingleScheduled(ThreadFactory threadFactory) 创建单个线程调度执行器static ExecutorServicenewSingleThreadExecutor(String namePrefix) 创建单个线程执行器static ExecutorServicenewSingleThreadExecutor(ThreadFactory threadFactory) 创建单个线程执行器
-
构造器详细资料
-
ExecutorUtil
public ExecutorUtil()
-
-
方法详细资料
-
newSingleThreadExecutor
创建单个线程执行器- 参数:
namePrefix- 线程名- 返回:
- 执行器
-
newSingleThreadExecutor
创建单个线程执行器- 参数:
threadFactory- 线程创建工厂- 返回:
- 执行器
-
newCacheThreadPool
创建线程池- 参数:
namePrefix- 线程名- 返回:
- 执行器
-
newCacheThreadPool
线程池- 参数:
threadFactory- 线程创建工厂- 返回:
- 执行器
-
newFixedThreadPool
创建固定大小线程执行器- 参数:
corePoolSize- 容量threadFactory- 线程工厂- 返回:
- 执行器
-
newFixedThreadPool
创建固定大小线程执行器- 参数:
corePoolSize- 容量namePrefix- 线程名- 返回:
- 执行器
-
newSingleScheduled
创建单个线程调度执行器- 参数:
threadFactory- 线程创建工厂- 返回:
- 调度 执行器
-
newSingleScheduled
创建单个线程调度执行器- 参数:
namePrefix- 线程名- 返回:
- 调度 执行器
-
newScheduled
创建指定数量 - 的线程调度执行器- 参数:
corePoolSize- 容量namePrefix- 线程名- 返回:
- 指定数量的 调度 执行器
-
newScheduled
创建指定数量 - 的线程调度执行器- 参数:
corePoolSize- 容量threadFactory- 线程创建工厂- 返回:
- 指定数量的 调度 执行器
-
createThreadFactory
创建 线程工厂daemon 参数默认是 true- 参数:
namePrefix- 线程名- 返回:
- 线程工厂
-
createThreadFactory
创建线程工厂- 参数:
namePrefix- 线程名前缀daemon- 置是否守护线程- 返回:
- 线程工厂
-