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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
destroy()
void
void
Deprecated.void
setWaitForJobsToCompleteOnShutdown
(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, shutdown
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.core.task.AsyncTaskExecutor
submitCompletable, submitCompletable
Methods 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:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
SchedulerConfigException
-
execute
-
execute
Deprecated.- Specified by:
execute
in interfaceorg.springframework.core.task.AsyncTaskExecutor
-
submit
- Specified by:
submit
in interfaceorg.springframework.core.task.AsyncTaskExecutor
-
submit
- Specified by:
submit
in interfaceorg.springframework.core.task.AsyncTaskExecutor
-
submitListenable
- Specified by:
submitListenable
in interfaceorg.springframework.core.task.AsyncListenableTaskExecutor
-
submitListenable
public <T> org.springframework.util.concurrent.ListenableFuture<T> submitListenable(Callable<T> task) - Specified by:
submitListenable
in interfaceorg.springframework.core.task.AsyncListenableTaskExecutor
-
destroy
public void destroy()- Specified by:
destroy
in interfaceorg.springframework.beans.factory.DisposableBean
-