JavaBean that allows for configuring a JDK 1.5 {@link java.util.concurrent.ThreadPoolExecutor}in bean style (through its "corePoolSize", "maxPoolSize", "keepAliveSeconds", "queueCapacity" properties), exposing it as a Spring {@link org.springframework.core.task.TaskExecutor}. This is an alternative to configuring a ThreadPoolExecutor instance directly using constructor injection, with a separate {@link ConcurrentTaskExecutor} adapter wrapping it.
For any custom needs, in particular for defining a {@link java.util.concurrent.ScheduledThreadPoolExecutor}, it is recommended to use a straight definition of the Executor instance or a factory method definition that points to the JDK 1.5 {@link java.util.concurrent.Executors} class.To expose such a raw Executor as a Spring {@link org.springframework.core.task.TaskExecutor}, simply wrap it with a {@link ConcurrentTaskExecutor} adapter.
NOTE: This class implements Spring's {@link org.springframework.core.task.TaskExecutor} interface as well as the JDK 1.5{@link java.util.concurrent.Executor} interface, with the former being the primaryinterface, the other just serving as secondary convenience. For this reason, the exception handling follows the TaskExecutor contract rather than the Executor contract, in particular regarding the {@link org.springframework.core.task.TaskRejectedException}.
@author Juergen Hoeller
@since 2.0
@see org.springframework.core.task.TaskExecutor
@see java.util.concurrent.Executor
@see java.util.concurrent.ThreadPoolExecutor
@see java.util.concurrent.ScheduledThreadPoolExecutor
@see java.util.concurrent.Executors
@see ConcurrentTaskExecutor