public class ThreadPool extends Object
| 构造器和说明 |
|---|
ThreadPool() |
| 限定符和类型 | 方法和说明 |
|---|---|
static ExecutorService |
getDefaultPool()
得到默认的线程池
#线程池说明,corePoolSize:池核心线程大小、maxSize:最大线程大小、queue:等待队列大小、keepAliveTime:
线程保存时间、unit:单位,默认为秒 #默认线程的配置
thread.pool.default.poolname=default thread.pool.default.coreSize=40 thread.pool.default.maxSize=60 thread.pool.default.queueSize=100 thread.pool.default.keepAliveTime=60 thread.pool.default.unit=SECONDS |
static Map<String,ExecutorService> |
getExecutorservicemap()
得到所有线程池
|
static ExecutorService |
getThreadPoolByName(String poolname,
Properties properties)
通过名字得到线程池
|
static void |
shutdown()
线程池关闭
|
public static final ExecutorService getThreadPoolByName(String poolname, Properties properties)
poolname - 池名properties - 要实例的池的属性public static void shutdown()
public static Map<String,ExecutorService> getExecutorservicemap()
public static final ExecutorService getDefaultPool()
Copyright © 2022. All rights reserved.