GrizzlyExecutorService#createInstance(org.glassfish.grizzly.threadpool.ThreadPoolConfig) . One can get a
default Grizzly ThreadPoolConfig using org.glassfish.grizzly.threadpool.ThreadPoolConfig#copy() and
customize it according to the application specific requirements.
A ThreadPoolConfig object might be customized in a "Builder"-like fashion:
ThreadPoolConfig.defaultConfig()
.setPoolName("App1Pool")
.setCorePoolSize(5)
.setMaxPoolSize(10);
| Modifier and Type | Field and Description |
|---|---|
| protected int | |
| private static final ThreadPoolConfig | |
| protected ClassLoader | |
| protected boolean | |
| protected long | |
| protected int | |
| protected MemoryManager | |
| protected String | |
| protected int | |
| protected Queue | |
| protected int | |
| protected ThreadFactory | |
| protected final DefaultMonitoringConfig | threadPoolMonitoringConfig
Thread pool probes |
| protected DelayedExecutor | |
| protected long |
| Access | Constructor and Description |
|---|---|
| private | ThreadPoolConfig(String poolName, int corePoolSize, int maxPoolSize, Queue<Runnable> queue, int queueLimit, long keepAliveTime, TimeUnit timeUnit, ThreadFactory threadFactory, int priority, boolean isDaemon, MemoryManager<E extends Buffer> mm, DelayedExecutor transactionMonitor, long transactionTimeoutMillis, ClassLoader initialClassLoader)
|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public ThreadPoolConfig | |
| public static ThreadPoolConfig | Returns: the Grizzly thread-pool configuration instance.Create new Grizzly thread-pool configuration instance. |
| public int | |
| public ClassLoader | getInitialClassLoader()
Returns: the classloader (if any) to be initially exposed by threads from this pool. |
| public DefaultMonitoringConfig | |
| public long | Returns: the keep-alive timeout, the value less than 0 means no timeoutReturns the max period of time a thread will wait for a new task to process. |
| public int | |
| public MemoryManager | |
| public String | |
| public int | |
| public Queue | |
| public int | |
| public ThreadFactory | |
| public DelayedExecutor | |
| public long | |
| public boolean | |
| public ThreadPoolConfig | setCorePoolSize(int
the core thread pool size corePoolSize)Returns: the |
| public ThreadPoolConfig | |
| public ThreadPoolConfig | Returns: theThreadPoolConfigthe classloader to be exposed by threads of this pool. initialClassLoader)Specifies the context classloader that will be used by threads in this pool. |
| public ThreadPoolConfig | Returns: theThreadPoolConfig with the new keep alive timemax keep alive timeout. The value less than 0 means no timeout time, TimeUnit time unit unit)The max period of time a thread will wait for a new task to process. |
| public ThreadPoolConfig | setMaxPoolSize(int
the max thread pool size maxPoolSize)Returns: the |
| public ThreadPoolConfig | |
| public ThreadPoolConfig | setPoolName(String
the thread pool name. poolname)Returns: the |
| public ThreadPoolConfig | |
| public ThreadPoolConfig | setQueue(Queue<Runnable>
the queue implemenation to use queue)Returns: the |
| public ThreadPoolConfig | setQueueLimit(int
the thread-pool queue limit. The queueLimit value less than 0 means unlimited queue. queueLimit)Returns: the |
| public ThreadPoolConfig | setThreadFactory(ThreadFactory
custom threadFactory)ThreadFactory If ThreadFactory is set - then priority,
isDaemon, poolName settings will not be considered when creating new threads.Returns: the |
| public ThreadPoolConfig | |
| public ThreadPoolConfig | |
| public ThreadPoolConfig | setTransactionTimeout(final DelayedExecutor transactionMonitor, final long transactionTimeout, final TimeUnit timeunit)
|
| public String |
| corePoolSize | back to summary |
|---|---|
| protected int corePoolSize | |
| DEFAULT | back to summary |
|---|---|
| private static final ThreadPoolConfig DEFAULT | |
| initialClassLoader | back to summary |
|---|---|
| protected ClassLoader initialClassLoader | |
| isDaemon | back to summary |
|---|---|
| protected boolean isDaemon | |
| keepAliveTimeMillis | back to summary |
|---|---|
| protected long keepAliveTimeMillis | |
| maxPoolSize | back to summary |
|---|---|
| protected int maxPoolSize | |
| mm | back to summary |
|---|---|
| protected MemoryManager<E extends Buffer> mm | |
| poolName | back to summary |
|---|---|
| protected String poolName | |
| priority | back to summary |
|---|---|
| protected int priority | |
| queue | back to summary |
|---|---|
| protected Queue<Runnable> queue | |
| queueLimit | back to summary |
|---|---|
| protected int queueLimit | |
| threadFactory | back to summary |
|---|---|
| protected ThreadFactory threadFactory | |
| threadPoolMonitoringConfig | back to summary |
|---|---|
| protected final DefaultMonitoringConfig<ThreadPoolProbe> threadPoolMonitoringConfig Thread pool probes | |
| transactionMonitor | back to summary |
|---|---|
| protected DelayedExecutor transactionMonitor | |
| transactionTimeoutMillis | back to summary |
|---|---|
| protected long transactionTimeoutMillis | |
| ThreadPoolConfig | back to summary |
|---|---|
| private ThreadPoolConfig(String poolName, int corePoolSize, int maxPoolSize, Queue<Runnable> queue, int queueLimit, long keepAliveTime, TimeUnit timeUnit, ThreadFactory threadFactory, int priority, boolean isDaemon, MemoryManager<E extends Buffer> mm, DelayedExecutor transactionMonitor, long transactionTimeoutMillis, ClassLoader initialClassLoader) | |
| ThreadPoolConfig | back to summary |
|---|---|
| private ThreadPoolConfig(ThreadPoolConfig cfg) | |
| copy | back to summary |
|---|---|
| public ThreadPoolConfig copy() | |
| defaultConfig | back to summary |
|---|---|
| public static ThreadPoolConfig defaultConfig() Create new Grizzly thread-pool configuration instance. The returned ThreadPoolConfig instance will be pre-configured with a default values.
| |
| getCorePoolSize | back to summary |
|---|---|
public int getCorePoolSize()
| |
| getInitialClassLoader | back to summary |
|---|---|
public ClassLoader getInitialClassLoader()
| |
| getInitialMonitoringConfig | back to summary |
|---|---|
| public DefaultMonitoringConfig | |
| getKeepAliveTime | back to summary |
|---|---|
| public long getKeepAliveTime(TimeUnit timeUnit) Returns the max period of time a thread will wait for a new task to process.
If the timeout expires and the thread is not a core one (see
| |
| getMaxPoolSize | back to summary |
|---|---|
public int getMaxPoolSize()
| |
| getMemoryManager | back to summary |
|---|---|
| public MemoryManager | |
| getPoolName | back to summary |
|---|---|
public String getPoolName()
| |
| getPriority | back to summary |
|---|---|
| public int getPriority() | |
| getQueue | back to summary |
|---|---|
| public Queue | |
| getQueueLimit | back to summary |
|---|---|
public int getQueueLimit()
| |
| getThreadFactory | back to summary |
|---|---|
| public ThreadFactory getThreadFactory() Returns
| |
| getTransactionMonitor | back to summary |
|---|---|
| public DelayedExecutor getTransactionMonitor() | |
| getTransactionTimeout | back to summary |
|---|---|
| public long getTransactionTimeout(final TimeUnit timeUnit) | |
| isDaemon | back to summary |
|---|---|
| public boolean isDaemon() | |
| setCorePoolSize | back to summary |
|---|---|
public ThreadPoolConfig setCorePoolSize(int corePoolSize)
| |
| setDaemon | back to summary |
|---|---|
| public ThreadPoolConfig setDaemon(boolean isDaemon) | |
| setInitialClassLoader | back to summary |
|---|---|
| public ThreadPoolConfig setInitialClassLoader(final ClassLoader initialClassLoader) Specifies the context classloader that will be used by threads in this pool. If not specified, the classloader of the parent thread that initialized the pool will be used.
| |
| setKeepAliveTime | back to summary |
|---|---|
| public ThreadPoolConfig setKeepAliveTime(long time, TimeUnit unit) The max period of time a thread will wait for a new task to process. If the timeout expires and the thread is not a
core one (see
| |
| setMaxPoolSize | back to summary |
|---|---|
public ThreadPoolConfig setMaxPoolSize(int maxPoolSize)
| |
| setMemoryManager | back to summary |
|---|---|
| public ThreadPoolConfig setMemoryManager(MemoryManager<E extends Buffer> mm) | |
| setPoolName | back to summary |
|---|---|
public ThreadPoolConfig setPoolName(String poolname)
| |
| setPriority | back to summary |
|---|---|
| public ThreadPoolConfig setPriority(int priority) | |
| setQueue | back to summary |
|---|---|
public ThreadPoolConfig setQueue(Queue<Runnable> queue)
| |
| setQueueLimit | back to summary |
|---|---|
public ThreadPoolConfig setQueueLimit(int queueLimit)
| |
| setThreadFactory | back to summary |
|---|---|
public ThreadPoolConfig setThreadFactory(ThreadFactory threadFactory)
| |
| setTransactionMonitor | back to summary |
|---|---|
| public ThreadPoolConfig setTransactionMonitor(final DelayedExecutor transactionMonitor) | |
| setTransactionTimeout | back to summary |
|---|---|
| public ThreadPoolConfig setTransactionTimeout(final long transactionTimeout, final TimeUnit timeunit) | |
| setTransactionTimeout | back to summary |
|---|---|
| public ThreadPoolConfig setTransactionTimeout(final DelayedExecutor transactionMonitor, final long transactionTimeout, final TimeUnit timeunit) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |