Top Description Fields Constructors Methods
org.springframework.scheduling.quartz

public Class SimpleThreadPoolTaskExecutor

extends org.quartz.simpl.SimpleThreadPool
implements AsyncListenableTaskExecutor, SchedulingTaskExecutor, InitializingBean, DisposableBean
Class Inheritance
All Implemented Interfaces
org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.scheduling.SchedulingTaskExecutor, org.springframework.core.task.AsyncTaskExecutor, org.springframework.core.task.TaskExecutor, java.util.concurrent.Executor, org.springframework.core.task.AsyncListenableTaskExecutor
Annotations
@SuppressWarnings:deprecation
Imports
java.util.concurrent.Callable, .Future, .FutureTask, org.quartz.SchedulerConfigException, org.quartz.simpl.SimpleThreadPool, org.springframework.beans.factory.DisposableBean, .InitializingBean, org.springframework.core.task.AsyncListenableTaskExecutor, org.springframework.scheduling.SchedulingException, .SchedulingTaskExecutor, org.springframework.util.Assert, org.springframework.util.concurrent.ListenableFuture, .ListenableFutureTask

References Deprecated

AsyncListenableTaskExecutor is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Subclass of Quartz's SimpleThreadPool that implements Spring's org.springframework.core.task.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).

Author
Juergen Hoeller
Since
2.0
See Also
org.quartz.simpl.SimpleThreadPool, org.springframework.core.task.TaskExecutor, SchedulerFactoryBean#setTaskExecutor

Field Summary

Modifier and TypeField and Description
private boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
afterPropertiesSet()

Implements org.springframework.beans.factory.InitializingBean.afterPropertiesSet.

Invoked by the containing BeanFactory after it has set all bean properties and satisfied BeanFactoryAware, ApplicationContextAware etc.

This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.

public void
destroy()

Implements org.springframework.beans.factory.DisposableBean.destroy.

Invoked by the containing BeanFactory on destruction of a bean.

public void
execute(Runnable
the Runnable to execute (never null)
task
)

Implements org.springframework.core.task.TaskExecutor.execute.

Execute the given task.

public void
setWaitForJobsToCompleteOnShutdown(boolean waitForJobsToCompleteOnShutdown)

Set whether to wait for running jobs to complete on shutdown.

public Future<?>
submit(Runnable
the Runnable to execute (never null)
task
)

Overrides default org.springframework.core.task.AsyncTaskExecutor.submit.

Submit a Runnable task for execution, receiving a Future representing that task.

public <T> Future<T>
submit(Callable<T>
the Callable to execute (never null)
task
)

Overrides default org.springframework.core.task.AsyncTaskExecutor.submit.

Submit a Callable task for execution, receiving a Future representing that task.

public ListenableFuture<?>
submitListenable(Runnable
the Runnable to execute (never null)
task
)

Implements org.springframework.core.task.AsyncListenableTaskExecutor.submitListenable.

References Deprecated ListenableFuture is deprecated or references (maybe indirectly) at least one deprecated element.

Submit a Runnable task for execution, receiving a ListenableFuture representing that task.

public <T> ListenableFuture<T>
submitListenable(Callable<T>
the Callable to execute (never null)
task
)

Implements org.springframework.core.task.AsyncListenableTaskExecutor.submitListenable.

References Deprecated ListenableFuture is deprecated or references (maybe indirectly) at least one deprecated element.

Submit a Callable task for execution, receiving a ListenableFuture representing that task.

Field Detail

waitForJobsToCompleteOnShutdownback to summary
private boolean waitForJobsToCompleteOnShutdown

Constructor Detail

SimpleThreadPoolTaskExecutorback to summary
public SimpleThreadPoolTaskExecutor()

Method Detail

afterPropertiesSetback to summary
public void afterPropertiesSet() throws org.quartz.SchedulerConfigException

Implements org.springframework.beans.factory.InitializingBean.afterPropertiesSet.

Doc from org.springframework.beans.factory.InitializingBean.afterPropertiesSet.

Invoked by the containing BeanFactory after it has set all bean properties and satisfied BeanFactoryAware, ApplicationContextAware etc.

This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.

Annotations
@Override
destroyback to summary
public void destroy()

Implements org.springframework.beans.factory.DisposableBean.destroy.

Doc from org.springframework.beans.factory.DisposableBean.destroy.

Invoked by the containing BeanFactory on destruction of a bean.

Annotations
@Override
executeback to summary
public void execute(Runnable task)

Implements org.springframework.core.task.TaskExecutor.execute.

Doc from org.springframework.core.task.TaskExecutor.execute.

Execute the given task.

The call might return immediately if the implementation uses an asynchronous execution strategy, or might block in the case of synchronous execution.

Parameters
task:Runnable

the Runnable to execute (never null)

Annotations
@Override
setWaitForJobsToCompleteOnShutdownback to summary
public void setWaitForJobsToCompleteOnShutdown(boolean waitForJobsToCompleteOnShutdown)

Set whether to wait for running jobs to complete on shutdown. Default is "false".

See Also
org.quartz.simpl.SimpleThreadPool#shutdown(boolean)
submitback to summary
public Future<?> submit(Runnable task)

Overrides default org.springframework.core.task.AsyncTaskExecutor.submit.

Doc from org.springframework.core.task.AsyncTaskExecutor.submit.

Submit a Runnable task for execution, receiving a Future representing that task. The Future will return a null result upon completion.

As of 6.1, this method comes with a default implementation that delegates to execute(Runnable).

Parameters
task:Runnable

the Runnable to execute (never null)

Returns:Future<?>

a Future representing pending completion of the task

Annotations
@Override
submitback to summary
public <T> Future<T> submit(Callable<T> task)

Overrides default org.springframework.core.task.AsyncTaskExecutor.submit.

Doc from org.springframework.core.task.AsyncTaskExecutor.submit.

Submit a Callable task for execution, receiving a Future representing that task. The Future will return the Callable's result upon completion.

As of 6.1, this method comes with a default implementation that delegates to execute(Runnable).

Parameters
task:Callable<T>

the Callable to execute (never null)

Returns:Future<T>

a Future representing pending completion of the task

Annotations
@Override
submitListenableback to summary
public ListenableFuture<?> submitListenable(Runnable task)

Implements org.springframework.core.task.AsyncListenableTaskExecutor.submitListenable.

Doc from org.springframework.core.task.AsyncListenableTaskExecutor.submitListenable.

References Deprecated

ListenableFuture is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Submit a Runnable task for execution, receiving a ListenableFuture representing that task. The Future will return a null result upon completion.

Parameters
task:Runnable

the Runnable to execute (never null)

Returns:ListenableFuture<?>

a ListenableFuture representing pending completion of the task

Annotations
@Override
submitListenableback to summary
public <T> ListenableFuture<T> submitListenable(Callable<T> task)

Implements org.springframework.core.task.AsyncListenableTaskExecutor.submitListenable.

Doc from org.springframework.core.task.AsyncListenableTaskExecutor.submitListenable.

References Deprecated

ListenableFuture is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Submit a Callable task for execution, receiving a ListenableFuture representing that task. The Future will return the Callable's result upon completion.

Parameters
task:Callable<T>

the Callable to execute (never null)

Returns:ListenableFuture<T>

a ListenableFuture representing pending completion of the task

Annotations
@Override