java.lang.Object | |
↳ | org.springframework.scheduling.timer.TimerTaskExecutor |
This class is deprecated.
as of Spring 3.0, in favor of the scheduling.concurrent
package which is based on Java 5's java.util.concurrent.ExecutorService
TaskExecutor
implementation that uses a
single Timer for executing all tasks, effectively resulting in
serialized asynchronous execution on a single thread.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
org.springframework.core.task.AsyncTaskExecutor
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
logger |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create a new TimerTaskExecutor that needs to be further configured and initialized.
| |||||||||||
Create a new TimerTaskExecutor for the given
Timer . |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Invoked by a BeanFactory after it has set all bean properties supplied
(and satisfied BeanFactoryAware and ApplicationContextAware).
| |||||||||||
Cancel the
Timer on bean factory shutdown, stopping all scheduled tasks. | |||||||||||
Execute the given
task . | |||||||||||
Schedules the given
Runnable on this executor's Timer instance,
wrapping it in a DelegatingTimerTask . | |||||||||||
This task executor prefers short-lived work units.
| |||||||||||
Set the name of the bean in the bean factory that created this bean.
| |||||||||||
Set the delay to use for scheduling tasks passed into the plain
execute(Runnable) method. | |||||||||||
Set the
Timer to use for this TimerTaskExecutor , for example
a shared Timer instance defined by a TimerFactoryBean . | |||||||||||
Submit a Callable task for execution, receiving a Future representing that task.
| |||||||||||
Submit a Runnable task for execution, receiving a Future representing that task.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create a new
Timer instance. | |||||||||||
Return the underlying Timer behind this TimerTaskExecutor.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
java.util.concurrent.Executor
| |||||||||||
From interface
org.springframework.beans.factory.BeanNameAware
| |||||||||||
From interface
org.springframework.beans.factory.DisposableBean
| |||||||||||
From interface
org.springframework.beans.factory.InitializingBean
| |||||||||||
From interface
org.springframework.core.task.AsyncTaskExecutor
| |||||||||||
From interface
org.springframework.core.task.TaskExecutor
| |||||||||||
From interface
org.springframework.scheduling.SchedulingTaskExecutor
|
Create a new TimerTaskExecutor that needs to be further configured and initialized.
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.
Execute the given task
.
task | the Runnable to execute (never null ) |
---|---|
startTimeout | the time duration (milliseconds) within which the task is
supposed to start. This is intended as a hint to the executor, allowing for
preferred handling of immediate tasks. Typical values are TIMEOUT_IMMEDIATE
or TIMEOUT_INDEFINITE (the default as used by execute(Runnable) ). |
Schedules the given Runnable
on this executor's Timer
instance,
wrapping it in a DelegatingTimerTask
.
task | the task to be executed |
---|
This task executor prefers short-lived work units.
true
if this TaskExecutor
prefers
short-lived tasks
Set the name of the bean in the bean factory that created this bean.
Invoked after population of normal bean properties but before an
init callback such as afterPropertiesSet()
or a custom init-method.
beanName | the name of the bean in the factory. Note that this name is the actual bean name used in the factory, which may differ from the originally specified name: in particular for inner bean names, the actual bean name might have been made unique through appending "#..." suffixes. Use the BeanFactoryUtils#originalBeanName(String) method to extract the original bean name (without suffix), if desired. |
---|
Set the delay to use for scheduling tasks passed into the plain
execute(Runnable)
method. Default is 0.
Note that calls to execute(Runnable, long)
will use the
given timeout as delay if it is lower than the general delay.
delay | the delay in milliseconds before the task is to be executed |
---|
Set the Timer
to use for this TimerTaskExecutor
, for example
a shared Timer
instance defined by a TimerFactoryBean
.
If not specified, a default internal Timer
instance will be used.
timer | the Timer to use for this TimerTaskExecutor |
---|
Submit a Callable task for execution, receiving a Future representing that task. The Future will return the Callable's result upon completion.
task | the Callable to execute (never null ) |
---|
Submit a Runnable task for execution, receiving a Future representing that task.
The Future will return a null
result upon completion.
task | the Runnable to execute (never null ) |
---|