类 ThreadPoolExecutorHandler
java.lang.Object
java.util.concurrent.AbstractExecutorService
java.util.concurrent.ThreadPoolExecutor
cn.sinozg.applet.common.handler.ThreadPoolExecutorHandler
- 所有已实现的接口:
Executor,ExecutorService
重写线程池 打印当前的线程信息
-
嵌套类概要
从类继承的嵌套类/接口 java.util.concurrent.ThreadPoolExecutor
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy -
字段概要
字段修饰符和类型字段说明private static final long线程池维护线程所允许的空闲时间private static final org.slf4j.Loggerprivate final String线程池名称private static final int队列最大长度 -
构造器概要
构造器构造器说明ThreadPoolExecutorHandler(int corePoolSize, int maximumPoolSize, long keepAliveTime, @NotNull TimeUnit unit, @NotNull BlockingQueue<Runnable> workQueue, String poolName, RejectedExecutionHandler handler) 初始化线程池ThreadPoolExecutorHandler(String poolName) 初始化线程池 核心数默认为 cpu+1 对列数为 8192 拒绝策略为抛出异常ThreadPoolExecutorHandler(String poolName, RejectedExecutionHandler handler) 初始化线程池 核心数默认为 cpu+1 对列数为 8192 -
方法概要
从类继承的方法 java.util.concurrent.ThreadPoolExecutor
afterExecute, allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, 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, toString从类继承的方法 java.util.concurrent.AbstractExecutorService
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submit
-
字段详细资料
-
构造器详细资料
-
ThreadPoolExecutorHandler
初始化线程池 核心数默认为 cpu+1 对列数为 8192 拒绝策略为抛出异常- 参数:
poolName- 线程名称
-
ThreadPoolExecutorHandler
初始化线程池 核心数默认为 cpu+1 对列数为 8192- 参数:
poolName- 线程名称handler- 拒绝策略
-
ThreadPoolExecutorHandler
public ThreadPoolExecutorHandler(int corePoolSize, int maximumPoolSize, long keepAliveTime, @NotNull @NotNull TimeUnit unit, @NotNull @NotNull BlockingQueue<Runnable> workQueue, String poolName, RejectedExecutionHandler handler) 初始化线程池- 参数:
corePoolSize- 核心数maximumPoolSize- 最大核心数keepAliveTime- 空闲时间unit- 空闲时间单位workQueue- 对列poolName- 线程名称handler- 拒绝策略
-
-
方法详细资料
-
beforeExecute
打印线程池运行状态- 覆盖:
beforeExecute在类中ThreadPoolExecutor- 参数:
t- the thread that will run taskrr- the task that will be executed
-