XMLThreadPoolFactory.java
724 字节
package com.tianbo.analysis.task;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
public class XMLThreadPoolFactory {
private static ThreadPoolExecutor threadPool;
public static ThreadPoolExecutor instance(){
if (threadPool==null){
XMLThreadFactory xmlThreadFactory = new XMLThreadFactory("xml");
threadPool = new ThreadPoolExecutor(10, 100,
0L, TimeUnit.MILLISECONDS,
new LinkedBlockingQueue<Runnable>(1024),
xmlThreadFactory,
new ThreadPoolExecutor.AbortPolicy());
}
return threadPool;
}
}