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(Runnable task) |
void |
execute(Runnable task,
long startTimeout)
Deprecated.
|
void |
setWaitForJobsToCompleteOnShutdown(boolean waitForJobsToCompleteOnShutdown)
Set whether to wait for running jobs to complete on shutdown.
|
<T> Future<T> |
submit(Callable<T> task) |
Future<?> |
submit(Runnable task) |
<T> org.springframework.util.concurrent.ListenableFuture<T> |
submitListenable(Callable<T> task) |
org.springframework.util.concurrent.ListenableFuture<?> |
submitListenable(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, shutdown
public void setWaitForJobsToCompleteOnShutdown(boolean waitForJobsToCompleteOnShutdown)
SimpleThreadPool.shutdown(boolean)
public void afterPropertiesSet() throws SchedulerConfigException
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
SchedulerConfigException
public void execute(Runnable task)
@Deprecated public void execute(Runnable task, long startTimeout)
execute
in interface org.springframework.core.task.AsyncTaskExecutor
public Future<?> submit(Runnable task)
submit
in interface org.springframework.core.task.AsyncTaskExecutor
public <T> Future<T> submit(Callable<T> task)
submit
in interface org.springframework.core.task.AsyncTaskExecutor
public org.springframework.util.concurrent.ListenableFuture<?> submitListenable(Runnable task)
submitListenable
in interface org.springframework.core.task.AsyncListenableTaskExecutor
public <T> org.springframework.util.concurrent.ListenableFuture<T> submitListenable(Callable<T> task)
submitListenable
in interface org.springframework.core.task.AsyncListenableTaskExecutor
public void destroy()
destroy
in interface org.springframework.beans.factory.DisposableBean