
public static final class EnhancedQueueExecutor.Builder extends Object
EnhancedQueueExecutor. All the fields are initialized to sensible defaults for
a small thread pool.| Constructor and Description |
|---|
Builder()
Construct a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
EnhancedQueueExecutor.Builder |
allowCoreThreadTimeOut(boolean allowCoreTimeOut)
Establish whether core threads are allowed to time out.
|
boolean |
allowsCoreThreadTimeOut()
Determine whether core threads are allowed to time out.
|
EnhancedQueueExecutor |
build()
Construct the executor from the configured parameters.
|
int |
getCorePoolSize()
Get the core pool size.
|
float |
getGrowthResistance()
Get the thread pool growth resistance.
|
long |
getKeepAliveTime(TimeUnit keepAliveUnits)
Get the thread keep-alive time.
|
int |
getMaximumPoolSize()
Get the maximum pool size.
|
int |
getMaximumQueueSize()
Get the maximum queue size.
|
Runnable |
getTerminationTask()
Get the termination task.
|
ThreadFactory |
getThreadFactory()
Get the configured thread factory.
|
EnhancedQueueExecutor.Builder |
setCorePoolSize(int coreSize)
Set the core pool size.
|
EnhancedQueueExecutor.Builder |
setGrowthResistance(float growthResistance)
Set the thread pool growth resistance.
|
EnhancedQueueExecutor.Builder |
setKeepAliveTime(long keepAliveTime,
TimeUnit keepAliveUnits)
Set the thread keep-alive time.
|
EnhancedQueueExecutor.Builder |
setMaximumPoolSize(int maxSize)
Set the maximum pool size.
|
EnhancedQueueExecutor.Builder |
setMaximumQueueSize(int maxQueueSize)
Set the maximum queue size.
|
EnhancedQueueExecutor.Builder |
setTerminationTask(Runnable terminationTask)
Set the termination task.
|
EnhancedQueueExecutor.Builder |
setThreadFactory(ThreadFactory threadFactory)
Set the configured thread factory.
|
public ThreadFactory getThreadFactory()
null)public EnhancedQueueExecutor.Builder setThreadFactory(ThreadFactory threadFactory)
threadFactory - the configured thread factory (must not be null)public Runnable getTerminationTask()
Runnable is used.null)public EnhancedQueueExecutor.Builder setTerminationTask(Runnable terminationTask)
terminationTask - the termination task (must not be null)public int getCorePoolSize()
EnhancedQueueExecutor.getCorePoolSize()public EnhancedQueueExecutor.Builder setCorePoolSize(int coreSize)
coreSize - the core pool size (must be greater than or equal to 0, and less than 2^20)EnhancedQueueExecutor.setCorePoolSize(int)public int getMaximumPoolSize()
EnhancedQueueExecutor.getMaximumPoolSize()public EnhancedQueueExecutor.Builder setMaximumPoolSize(int maxSize)
maxSize - the maximum pool size (must be greater than or equal to 0, and less than 2^20)EnhancedQueueExecutor.setMaximumPoolSize(int)public long getKeepAliveTime(TimeUnit keepAliveUnits)
keepAliveUnits - the time keepAliveUnits of the keep-alive time (must not be null)EnhancedQueueExecutor.getKeepAliveTime(TimeUnit)public EnhancedQueueExecutor.Builder setKeepAliveTime(long keepAliveTime, TimeUnit keepAliveUnits)
keepAliveTime - the thread keep-alive time (must be greater than 0)keepAliveUnits - the time keepAliveUnits of the keep-alive time (must not be null)EnhancedQueueExecutor.setKeepAliveTime(long, TimeUnit)public float getGrowthResistance()
0.0 indicates that tasks should
not be enqueued until the pool is completely full; a value of 1.0 indicates that tasks should always
be enqueued until the queue is completely full.EnhancedQueueExecutor.getGrowthResistance()public EnhancedQueueExecutor.Builder setGrowthResistance(float growthResistance)
growthResistance - the thread pool growth resistance (must be in the range 0.0f ≤ n ≤ 1.0f)getGrowthResistance(),
EnhancedQueueExecutor.setGrowthResistance(float)public boolean allowsCoreThreadTimeOut()
true if core threads are allowed to time out, false otherwiseEnhancedQueueExecutor.allowsCoreThreadTimeOut()public EnhancedQueueExecutor.Builder allowCoreThreadTimeOut(boolean allowCoreTimeOut)
value - true if core threads are allowed to time out, false otherwiseEnhancedQueueExecutor.allowCoreThreadTimeOut(boolean)public int getMaximumQueueSize()
EnhancedQueueExecutor.getMaximumQueueSize()public EnhancedQueueExecutor.Builder setMaximumQueueSize(int maxQueueSize)
maxQueueSize - the maximum queue size (must be ≥ 0)EnhancedQueueExecutor.setMaximumQueueSize(int)public EnhancedQueueExecutor build()
null)Copyright © 2017 JBoss by Red Hat. All rights reserved.