org.glassfish.grizzly.threadpool
Class ThreadPoolConfig
java.lang.Object
org.glassfish.grizzly.threadpool.ThreadPoolConfig
public class ThreadPoolConfig
- extends java.lang.Object
- Author:
- Oleksiy Stashok, gustav trede
|
Constructor Summary |
ThreadPoolConfig(java.lang.String poolName,
int corePoolSize,
int maxPoolSize,
java.util.Queue<java.lang.Runnable> queue,
int queueLimit,
long keepAliveTime,
java.util.concurrent.TimeUnit timeUnit,
java.util.concurrent.ThreadFactory threadFactory,
int priority,
MemoryManager mm,
DelayedExecutor transactionMonitor,
long transactionTimeoutMillis)
|
ThreadPoolConfig(ThreadPoolConfig cfg)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
poolName
protected java.lang.String poolName
corePoolSize
protected int corePoolSize
maxPoolSize
protected int maxPoolSize
queue
protected java.util.Queue<java.lang.Runnable> queue
queueLimit
protected int queueLimit
keepAliveTimeMillis
protected long keepAliveTimeMillis
threadFactory
protected java.util.concurrent.ThreadFactory threadFactory
priority
protected int priority
mm
protected MemoryManager mm
transactionMonitor
protected DelayedExecutor transactionMonitor
transactionTimeoutMillis
protected long transactionTimeoutMillis
threadPoolMonitoringConfig
protected final MonitoringConfigImpl<ThreadPoolProbe> threadPoolMonitoringConfig
- Thread pool probes
ThreadPoolConfig
public ThreadPoolConfig(java.lang.String poolName,
int corePoolSize,
int maxPoolSize,
java.util.Queue<java.lang.Runnable> queue,
int queueLimit,
long keepAliveTime,
java.util.concurrent.TimeUnit timeUnit,
java.util.concurrent.ThreadFactory threadFactory,
int priority,
MemoryManager mm,
DelayedExecutor transactionMonitor,
long transactionTimeoutMillis)
ThreadPoolConfig
public ThreadPoolConfig(ThreadPoolConfig cfg)
defaultConfig
public static ThreadPoolConfig defaultConfig()
copy
public ThreadPoolConfig copy()
getQueue
public java.util.Queue<java.lang.Runnable> getQueue()
- Returns:
- the queue
setQueue
public ThreadPoolConfig setQueue(java.util.Queue<java.lang.Runnable> queue)
- Parameters:
queue - the queue implemenation to use
- Returns:
- the
ThreadPoolConfig with the new Queue implementation.
getThreadFactory
public java.util.concurrent.ThreadFactory getThreadFactory()
- Returns:
- the threadFactory
setThreadFactory
public ThreadPoolConfig setThreadFactory(java.util.concurrent.ThreadFactory threadFactory)
- Parameters:
threadFactory - custom ThreadFactory
- Returns:
- the
ThreadPoolConfig with the new ThreadFactory
getPoolName
public java.lang.String getPoolName()
- Returns:
- the poolname
setPoolName
public ThreadPoolConfig setPoolName(java.lang.String poolname)
- Parameters:
poolname - the thread pool name.
- Returns:
- the
ThreadPoolConfig with the new thread pool name.
getPriority
public int getPriority()
setPriority
public ThreadPoolConfig setPriority(int priority)
getMaxPoolSize
public int getMaxPoolSize()
- Returns:
- the maxpoolsize
setMaxPoolSize
public ThreadPoolConfig setMaxPoolSize(int maxPoolSize)
- Parameters:
maxPoolSize - the max thread pool size
- Returns:
- the
ThreadPoolConfig with the new max pool size
getCorePoolSize
public int getCorePoolSize()
- Returns:
- the corepoolsize
setCorePoolSize
public ThreadPoolConfig setCorePoolSize(int corePoolSize)
- Parameters:
corePoolSize - the core thread pool size
- Returns:
- the
ThreadPoolConfig with the new core pool size
getQueueLimit
public int getQueueLimit()
- Returns:
- the queuelimit
setQueueLimit
public ThreadPoolConfig setQueueLimit(int queueLimit)
- Parameters:
queueLimit - the queue limit
- Returns:
- the
ThreadPoolConfig with the new queue limite
setKeepAliveTime
public ThreadPoolConfig setKeepAliveTime(long time,
java.util.concurrent.TimeUnit unit)
- Parameters:
time - max keep alive timeunit - time unit
- Returns:
- the
ThreadPoolConfig with the new keep alive time
getKeepAliveTime
public long getKeepAliveTime(java.util.concurrent.TimeUnit timeUnit)
- Returns:
- the keepAliveTime
getMemoryManager
public MemoryManager getMemoryManager()
setMemoryManager
public ThreadPoolConfig setMemoryManager(MemoryManager mm)
getInitialMonitoringConfig
public MonitoringConfigImpl<ThreadPoolProbe> getInitialMonitoringConfig()
getTransactionMonitor
public DelayedExecutor getTransactionMonitor()
setTransactionMonitor
public ThreadPoolConfig setTransactionMonitor(DelayedExecutor transactionMonitor)
getTransactionTimeout
public long getTransactionTimeout(java.util.concurrent.TimeUnit timeUnit)
setTransactionTimeout
public ThreadPoolConfig setTransactionTimeout(long transactionTimeout,
java.util.concurrent.TimeUnit timeunit)
setTransactionTimeout
public ThreadPoolConfig setTransactionTimeout(DelayedExecutor transactionMonitor,
long transactionTimeout,
java.util.concurrent.TimeUnit timeunit)
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object
Copyright © 2012 Oracle Corporation. All Rights Reserved.