XMLThreadPoolFactory.java 720 字节
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(15, 240,
                    0L, TimeUnit.MILLISECONDS,
                    new LinkedBlockingQueue<Runnable>(),
                    xmlThreadFactory,
                    new ThreadPoolExecutor.AbortPolicy());
        }
        return threadPool;
    }
}