XMLThreadPoolFactory.java 716 字节
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, 128,
                    60L, TimeUnit.SECONDS,
                    new LinkedBlockingQueue<Runnable>(),
                    xmlThreadFactory,
                    new ThreadPoolExecutor.AbortPolicy());
        }
        return threadPool;
    }
}