扩展ThreadPoolExecutor
来源:互联网 发布:家常菜谱软件下载 编辑:程序博客网 时间:2024/06/14 14:00
public class MyThreadPoolExecutor extends ThreadPoolExecutor { public MyThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue) { super(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue); } /* * (non-Javadoc) * * @see * java.util.concurrent.ThreadPoolExecutor#beforeExecute(java.lang.Thread, * java.lang.Runnable) */ @Override protected void beforeExecute(Thread t, Runnable r) { System.out.println("beforeExecute ThreadName:" + ((Thread) r).getName() + " TID:" + t.getId()); } /* * (non-Javadoc) * * @see * java.util.concurrent.ThreadPoolExecutor#afterExecute(java.lang.Runnable, * java.lang.Throwable) */ @Override protected void afterExecute(Runnable r, Throwable t) { System.out.println("afterExecute TID:" + Thread.currentThread().getId()); System.out.println("afterExecute PoolSize:" + this.getPoolSize()); }}
阅读全文
0 0
- 扩展ThreadPoolExecutor
- ThreadPoolExecutor 扩展
- JAVA多线程之扩展ThreadPoolExecutor
- J.U.C--扩展ThreadPoolExecutor
- 扩展ThreadPoolExecutor的一种办法
- 扩展ThreadPoolExecutor的一种办法
- 扩展线程池ThreadPoolExecutor的简单例子
- 扩展ThreadPoolExecutor打印线程错误堆栈
- ThreadPoolExecutor线程池及线程扩展策略
- ThreadPoolExecutor
- ThreadPoolExecutor
- ThreadPoolExecutor
- ThreadPoolExecutor
- ThreadPoolExecutor
- ThreadPoolExecutor
- ThreadPoolExecutor
- ThreadPoolExecutor
- ThreadPoolExecutor
- Java监听器
- POJ3662-Telephone Lines
- opengles(一) hello world
- mongoose模糊查询+限制条件
- [PAT-乙级]1046.划拳
- 扩展ThreadPoolExecutor
- C# 反射
- 虚拟机Ubuntu下使用串口短信猫
- 数位DP小结
- 【shell】判断文件中是否存在字符串
- System.getProperty()参数大全
- 环境搭建,与入门
- windows cmd javac乱码
- 公共技术点之 Java 注解 Annotation