Class SimpleThreadPoolTaskExecutor

java.lang.Object
org.quartz.simpl.SimpleThreadPool
org.springframework.scheduling.quartz.SimpleThreadPoolTaskExecutor
All Implemented Interfaces:
Executor, ThreadPool, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.core.task.AsyncListenableTaskExecutor, org.springframework.core.task.AsyncTaskExecutor, org.springframework.core.task.TaskExecutor, org.springframework.scheduling.SchedulingTaskExecutor

public class SimpleThreadPoolTaskExecutor extends SimpleThreadPool implements org.springframework.core.task.AsyncListenableTaskExecutor, org.springframework.scheduling.SchedulingTaskExecutor, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
Subclass of Quartz's SimpleThreadPool that implements Spring's TaskExecutor interface and listens to Spring lifecycle callbacks.

Can be shared between a Quartz Scheduler (specified as "taskExecutor") and other TaskExecutor users, or even used completely independent of a Quartz Scheduler (as plain TaskExecutor backend).

Since:
2.0
Author:
Juergen Hoeller
See Also:
  • Constructor Details

    • SimpleThreadPoolTaskExecutor

      public SimpleThreadPoolTaskExecutor()
  • Method Details

    • setWaitForJobsToCompleteOnShutdown

      public void setWaitForJobsToCompleteOnShutdown(boolean waitForJobsToCompleteOnShutdown)
      Set whether to wait for running jobs to complete on shutdown. Default is "false".
      See Also:
    • afterPropertiesSet

      public void afterPropertiesSet() throws SchedulerConfigException
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Throws:
      SchedulerConfigException
    • execute

      public void execute(Runnable task)
      Specified by:
      execute in interface Executor
      Specified by:
      execute in interface org.springframework.core.task.TaskExecutor
    • submit

      public Future<?> submit(Runnable task)
      Specified by:
      submit in interface org.springframework.core.task.AsyncTaskExecutor
    • submit

      public <T> Future<T> submit(Callable<T> task)
      Specified by:
      submit in interface org.springframework.core.task.AsyncTaskExecutor
    • submitListenable

      public org.springframework.util.concurrent.ListenableFuture<?> submitListenable(Runnable task)
      Specified by:
      submitListenable in interface org.springframework.core.task.AsyncListenableTaskExecutor
    • submitListenable

      public <T> org.springframework.util.concurrent.ListenableFuture<T> submitListenable(Callable<T> task)
      Specified by:
      submitListenable in interface org.springframework.core.task.AsyncListenableTaskExecutor
    • destroy

      public void destroy()
      Specified by:
      destroy in interface org.springframework.beans.factory.DisposableBean