public class ThreadPoolConfig extends Object
| Modifier and Type | Field and Description |
|---|---|
protected int |
corePoolSize |
protected long |
keepAliveTimeMillis |
protected int |
maxPoolSize |
protected MemoryManager |
mm |
protected String |
poolName |
protected int |
priority |
protected Queue<Runnable> |
queue |
protected int |
queueLimit |
protected ThreadFactory |
threadFactory |
protected MonitoringConfigImpl<ThreadPoolProbe> |
threadPoolMonitoringConfig
Thread pool probes
|
protected DelayedExecutor |
transactionMonitor |
protected long |
transactionTimeoutMillis |
| Constructor and Description |
|---|
ThreadPoolConfig(String poolName,
int corePoolSize,
int maxPoolSize,
Queue<Runnable> queue,
int queueLimit,
long keepAliveTime,
TimeUnit timeUnit,
ThreadFactory threadFactory,
int priority,
MemoryManager mm,
DelayedExecutor transactionMonitor,
long transactionTimeoutMillis) |
ThreadPoolConfig(ThreadPoolConfig cfg) |
protected String poolName
protected int corePoolSize
protected int maxPoolSize
protected int queueLimit
protected long keepAliveTimeMillis
protected ThreadFactory threadFactory
protected int priority
protected MemoryManager mm
protected DelayedExecutor transactionMonitor
protected long transactionTimeoutMillis
protected final MonitoringConfigImpl<ThreadPoolProbe> threadPoolMonitoringConfig
public ThreadPoolConfig(String poolName, int corePoolSize, int maxPoolSize, Queue<Runnable> queue, int queueLimit, long keepAliveTime, TimeUnit timeUnit, ThreadFactory threadFactory, int priority, MemoryManager mm, DelayedExecutor transactionMonitor, long transactionTimeoutMillis)
public ThreadPoolConfig(ThreadPoolConfig cfg)
public static ThreadPoolConfig defaultConfig()
public ThreadPoolConfig copy()
public ThreadPoolConfig setQueue(Queue<Runnable> queue)
queue - the queue implemenation to useThreadPoolConfig with the new Queue implementation.public ThreadFactory getThreadFactory()
public ThreadPoolConfig setThreadFactory(ThreadFactory threadFactory)
threadFactory - custom ThreadFactoryThreadPoolConfig with the new ThreadFactorypublic String getPoolName()
public ThreadPoolConfig setPoolName(String poolname)
poolname - the thread pool name.ThreadPoolConfig with the new thread pool name.public int getPriority()
public ThreadPoolConfig setPriority(int priority)
public int getMaxPoolSize()
public ThreadPoolConfig setMaxPoolSize(int maxPoolSize)
maxPoolSize - the max thread pool sizeThreadPoolConfig with the new max pool sizepublic int getCorePoolSize()
public ThreadPoolConfig setCorePoolSize(int corePoolSize)
corePoolSize - the core thread pool sizeThreadPoolConfig with the new core pool sizepublic int getQueueLimit()
public ThreadPoolConfig setQueueLimit(int queueLimit)
queueLimit - the queue limitThreadPoolConfig with the new queue limitepublic ThreadPoolConfig setKeepAliveTime(long time, TimeUnit unit)
setCorePoolSize(int), setMaxPoolSize(int)) -
then the thread will be terminated and removed from the thread pool.time - max keep alive timeout. The value less than 0 means no timeoutunit - time unitThreadPoolConfig with the new keep alive timepublic long getKeepAliveTime(TimeUnit timeUnit)
setCorePoolSize(int), setMaxPoolSize(int)) -
then the thread will be terminated and removed from the thread pool.public MemoryManager getMemoryManager()
public ThreadPoolConfig setMemoryManager(MemoryManager mm)
public MonitoringConfigImpl<ThreadPoolProbe> getInitialMonitoringConfig()
public DelayedExecutor getTransactionMonitor()
public ThreadPoolConfig setTransactionMonitor(DelayedExecutor transactionMonitor)
public long getTransactionTimeout(TimeUnit timeUnit)
public ThreadPoolConfig setTransactionTimeout(long transactionTimeout, TimeUnit timeunit)
public ThreadPoolConfig setTransactionTimeout(DelayedExecutor transactionMonitor, long transactionTimeout, TimeUnit timeunit)
Copyright © 2013 Oracle Corporation. All Rights Reserved.