ThreadPoolTaskExecutorBuilder

Builder that can be used to configure and create a ThreadPoolTaskExecutor. Provides convenience methods to set common ThreadPoolTaskExecutor settings and register taskDecorator). For advanced configuration, consider using ThreadPoolTaskExecutorCustomizer.

In a typical auto-configured Spring Boot application this builder is available as a bean and can be injected whenever a ThreadPoolTaskExecutor is needed.

Author

Stephane Nicoll

Filip Hrisafov

Yanming Zhou

Since

3.2.0

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open fun acceptTasksAfterContextClose(acceptTasksAfterContextClose: Boolean): ThreadPoolTaskExecutorBuilder
Set whether to accept further tasks after the application context close phase has begun.
Link copied to clipboard
Set whether core threads are allowed to time out.
Link copied to clipboard
Set whether the executor should wait for scheduled tasks to complete on shutdown, not interrupting running tasks and executing all tasks in the queue.
Link copied to clipboard
Set the maximum time the executor is supposed to block on shutdown.
Link copied to clipboard
Build a new ThreadPoolTaskExecutor instance and configure it using this builder.
open fun <T : ThreadPoolTaskExecutor?> build(taskExecutorClass: Class<T>): T
Build a new ThreadPoolTaskExecutor instance of the specified type and configure it using this builder.
Link copied to clipboard
open fun <T : ThreadPoolTaskExecutor?> configure(taskExecutor: T): T
Configure the provided ThreadPoolTaskExecutor instance using this builder.
Link copied to clipboard
Set the core number of threads.
Link copied to clipboard
Set the time limit for which threads may remain idle before being terminated.
Link copied to clipboard
Set the maximum allowed number of threads.
Link copied to clipboard
Set the capacity of the queue.
Link copied to clipboard
Set the TaskDecorator to use or null to not use any.
Link copied to clipboard
Set the prefix to use for the names of newly created threads.