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
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).
SimpleThreadPool,
TaskExecutor,
SchedulerFactoryBean.setTaskExecutor(java.util.concurrent.Executor)| Constructor and Description |
|---|
SimpleThreadPoolTaskExecutor() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
void |
destroy() |
void |
execute(java.lang.Runnable task) |
void |
execute(java.lang.Runnable task,
long startTimeout) |
boolean |
prefersShortLivedTasks()
This task executor prefers short-lived work units.
|
void |
setWaitForJobsToCompleteOnShutdown(boolean waitForJobsToCompleteOnShutdown)
Set whether to wait for running jobs to complete on shutdown.
|
<T> java.util.concurrent.Future<T> |
submit(java.util.concurrent.Callable<T> task) |
java.util.concurrent.Future<?> |
submit(java.lang.Runnable task) |
<T> org.springframework.util.concurrent.ListenableFuture<T> |
submitListenable(java.util.concurrent.Callable<T> task) |
org.springframework.util.concurrent.ListenableFuture<?> |
submitListenable(java.lang.Runnable task) |
blockForAvailableThreads, clearFromBusyWorkersList, createWorkerThreads, getLog, getPoolSize, getThreadCount, getThreadNamePrefix, getThreadPriority, initialize, isMakeThreadsDaemons, isThreadsInheritContextClassLoaderOfInitializingThread, isThreadsInheritGroupOfInitializingThread, makeAvailable, runInThread, setInstanceId, setInstanceName, setMakeThreadsDaemons, setThreadCount, setThreadNamePrefix, setThreadPriority, setThreadsInheritContextClassLoaderOfInitializingThread, setThreadsInheritGroupOfInitializingThread, shutdown, shutdownpublic void setWaitForJobsToCompleteOnShutdown(boolean waitForJobsToCompleteOnShutdown)
SimpleThreadPool.shutdown(boolean)public void afterPropertiesSet()
throws SchedulerConfigException
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanSchedulerConfigExceptionpublic void execute(java.lang.Runnable task)
execute in interface java.util.concurrent.Executorexecute in interface org.springframework.core.task.TaskExecutorpublic void execute(java.lang.Runnable task,
long startTimeout)
execute in interface org.springframework.core.task.AsyncTaskExecutorpublic java.util.concurrent.Future<?> submit(java.lang.Runnable task)
submit in interface org.springframework.core.task.AsyncTaskExecutorpublic <T> java.util.concurrent.Future<T> submit(java.util.concurrent.Callable<T> task)
submit in interface org.springframework.core.task.AsyncTaskExecutorpublic org.springframework.util.concurrent.ListenableFuture<?> submitListenable(java.lang.Runnable task)
submitListenable in interface org.springframework.core.task.AsyncListenableTaskExecutorpublic <T> org.springframework.util.concurrent.ListenableFuture<T> submitListenable(java.util.concurrent.Callable<T> task)
submitListenable in interface org.springframework.core.task.AsyncListenableTaskExecutorpublic boolean prefersShortLivedTasks()
prefersShortLivedTasks in interface org.springframework.scheduling.SchedulingTaskExecutorpublic void destroy()
destroy in interface org.springframework.beans.factory.DisposableBean