package com.sy.utils; 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(String busstype){ if (threadPool==null){ XMLThreadFactory xmlThreadFactory = new XMLThreadFactory(busstype); threadPool = new ThreadPoolExecutor(50, 200, 1L, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(4000), xmlThreadFactory, new ThreadPoolExecutor.AbortPolicy()); } return threadPool; } }