public class TaskExecutorRegistration
extends java.lang.Object
ThreadPoolTaskExecutor
.Constructor and Description |
---|
TaskExecutorRegistration() |
TaskExecutorRegistration(ThreadPoolTaskExecutor taskExecutor) |
Modifier and Type | Method and Description |
---|---|
TaskExecutorRegistration |
corePoolSize(int corePoolSize)
Set the core pool size of the ThreadPoolExecutor.
|
protected ThreadPoolTaskExecutor |
getTaskExecutor() |
TaskExecutorRegistration |
keepAliveSeconds(int keepAliveSeconds)
Set the time limit for which threads may remain idle before being terminated.
|
TaskExecutorRegistration |
maxPoolSize(int maxPoolSize)
Set the max pool size of the ThreadPoolExecutor.
|
TaskExecutorRegistration |
queueCapacity(int queueCapacity)
Set the queue capacity for the ThreadPoolExecutor.
|
public TaskExecutorRegistration()
public TaskExecutorRegistration(ThreadPoolTaskExecutor taskExecutor)
public TaskExecutorRegistration corePoolSize(int corePoolSize)
NOTE: The core pool size is effectively the max pool size
when an unbounded queueCapacity
is configured
(the default). This is essentially the "Unbounded queues" strategy as explained
in ThreadPoolExecutor
. When
this strategy is used, the maxPoolSize
is ignored.
By default this is set to twice the value of
Runtime.availableProcessors()
. In an an application where tasks do not
block frequently, the number should be closer to or equal to the number of
available CPUs/cores.
public TaskExecutorRegistration maxPoolSize(int maxPoolSize)
NOTE: When an unbounded
queueCapacity
is configured (the default), the
max pool size is effectively ignored. See the "Unbounded queues" strategy
in ThreadPoolExecutor
for
more details.
By default this is set to Integer.MAX_VALUE
.
public TaskExecutorRegistration queueCapacity(int queueCapacity)
NOTE: when an unbounded queueCapacity
is configured
(the default), the core pool size is effectively the max pool size. This is
essentially the "Unbounded queues" strategy as explained in
ThreadPoolExecutor
. When
this strategy is used, the maxPoolSize
is ignored.
By default this is set to Integer.MAX_VALUE
.
public TaskExecutorRegistration keepAliveSeconds(int keepAliveSeconds)
By default this is set to 60.
protected ThreadPoolTaskExecutor getTaskExecutor()