标签:
1 package com.dawning.gridview.app.resourcemanagement.service.servicemanagement.discoverresourceutil; 2 3 import java.util.concurrent.ExecutorService; 4 import java.util.concurrent.Executors; 5 6 /** 7 * 线程池单例 8 * @class SingletonTheadPool 9 * @date 2015-7-7 下午3:29:04 10 * @author wanghc 11 */ 12 public class SingletonTheadPool { 13 /** 14 * 单例 15 */ 16 private static class SingletonHolder{ 17 private static final ExecutorService MYPOOL = Executors.newFixedThreadPool(2); 18 } 19 20 private SingletonTheadPool(){}; 21 22 public static final ExecutorService getSingletonTheadPool(){ 23 24 return SingletonHolder.MYPOOL; 25 } 26 27 }
标签:
原文地址:http://www.cnblogs.com/My-Cloud/p/4674227.html