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:
-
Field Summary
Fields inherited from interface org.springframework.core.task.AsyncTaskExecutor
TIMEOUT_IMMEDIATE, TIMEOUT_INDEFINITE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoiddestroy()voidvoidsetWaitForJobsToCompleteOnShutdown(boolean waitForJobsToCompleteOnShutdown) Set whether to wait for running jobs to complete on shutdown.Future<?><T> Future<T>org.springframework.util.concurrent.ListenableFuture<?>submitListenable(Runnable task) <T> org.springframework.util.concurrent.ListenableFuture<T>submitListenable(Callable<T> task) Methods inherited from class org.quartz.simpl.SimpleThreadPool
blockForAvailableThreads, clearFromBusyWorkersList, createWorkerThreads, getLog, getPoolSize, getThreadCount, getThreadNamePrefix, getThreadPriority, initialize, isMakeThreadsDaemons, isThreadsInheritContextClassLoaderOfInitializingThread, isThreadsInheritGroupOfInitializingThread, makeAvailable, runInThread, setInstanceId, setInstanceName, setMakeThreadsDaemons, setThreadCount, setThreadNamePrefix, setThreadPriority, setThreadsInheritContextClassLoaderOfInitializingThread, setThreadsInheritGroupOfInitializingThread, shutdown, shutdownMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.core.task.AsyncTaskExecutor
execute, submitCompletable, submitCompletableMethods inherited from interface org.springframework.scheduling.SchedulingTaskExecutor
prefersShortLivedTasks
-
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
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
SchedulerConfigException
-
execute
-
submit
- Specified by:
submitin interfaceorg.springframework.core.task.AsyncTaskExecutor
-
submit
- Specified by:
submitin interfaceorg.springframework.core.task.AsyncTaskExecutor
-
submitListenable
- Specified by:
submitListenablein interfaceorg.springframework.core.task.AsyncListenableTaskExecutor
-
submitListenable
public <T> org.springframework.util.concurrent.ListenableFuture<T> submitListenable(Callable<T> task) - Specified by:
submitListenablein interfaceorg.springframework.core.task.AsyncListenableTaskExecutor
-
destroy
public void destroy()- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean
-