Class ConcurrentTaskScheduler

All Implemented Interfaces:
Executor, AsyncListenableTaskExecutor, AsyncTaskExecutor, TaskExecutor, SchedulingTaskExecutor, TaskScheduler
Direct Known Subclasses:

public class ConcurrentTaskScheduler extends ConcurrentTaskExecutor implements TaskScheduler
Adapter that takes a java.util.concurrent.ScheduledExecutorService and exposes a Spring TaskScheduler for it. Extends ConcurrentTaskExecutor in order to implement the SchedulingTaskExecutor interface as well.

Autodetects a JSR-236 ManagedScheduledExecutorService in order to use it for trigger-based scheduling if possible, instead of Spring's local trigger management which ends up delegating to regular delay-based scheduling against the java.util.concurrent.ScheduledExecutorService API. For JSR-236 style lookup in a Jakarta EE environment, consider using DefaultManagedTaskScheduler.

Note that there is a pre-built ThreadPoolTaskScheduler that allows for defining a ScheduledThreadPoolExecutor in bean style, exposing it as a Spring TaskScheduler directly. This is a convenient alternative to a raw ScheduledThreadPoolExecutor definition with a separate definition of the present adapter class.

Juergen Hoeller, Mark Fisher, Arjen Poutsma
See Also: