java.lang.Object | |
↳ | org.springframework.scheduling.timer.ScheduledTimerTask |
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
JavaBean that describes a scheduled TimerTask, consisting of the TimerTask itself or a Runnable to create a TimerTask for and a delay plus period. The period needs to be specified; there is no point in a default for it.
The JDK's Timer
facility does not offer sophisticated
scheduling options such as cron expressions. Consider using Quartz for
such advanced needs.
Note that the Timer
mechanism uses a TimerTask
instance that is shared between repeated executions, in contrast to Quartz
which creates a new Job instance for each execution.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create a new ScheduledTimerTask,
to be populated via bean properties.
| |||||||||||
Create a new ScheduledTimerTask, with default
one-time execution without delay.
| |||||||||||
Create a new ScheduledTimerTask, with default
one-time execution with the given delay.
| |||||||||||
Create a new ScheduledTimerTask.
| |||||||||||
Create a new ScheduledTimerTask, with default
one-time execution without delay.
| |||||||||||
Create a new ScheduledTimerTask, with default
one-time execution with the given delay.
| |||||||||||
Create a new ScheduledTimerTask.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Return the delay before starting the job for the first time.
| |||||||||||
Return the period between repeated task executions.
| |||||||||||
Return the TimerTask to schedule.
| |||||||||||
Return whether to schedule as fixed-rate execution.
| |||||||||||
Is this task only ever going to execute once?
| |||||||||||
Set the delay before starting the task for the first time,
in milliseconds.
| |||||||||||
Set whether to schedule as fixed-rate execution, rather than
fixed-delay execution.
| |||||||||||
Set the period between repeated task executions, in milliseconds.
| |||||||||||
Set the Runnable to schedule as TimerTask.
| |||||||||||
Set the TimerTask to schedule.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Create a new ScheduledTimerTask, to be populated via bean properties.
Create a new ScheduledTimerTask, with default one-time execution without delay.
timerTask | the TimerTask to schedule |
---|
Create a new ScheduledTimerTask, with default one-time execution with the given delay.
timerTask | the TimerTask to schedule |
---|---|
delay | the delay before starting the task for the first time (ms) |
Create a new ScheduledTimerTask.
timerTask | the TimerTask to schedule |
---|---|
delay | the delay before starting the task for the first time (ms) |
period | the period between repeated task executions (ms) |
fixedRate | whether to schedule as fixed-rate execution |
Create a new ScheduledTimerTask, with default one-time execution without delay.
timerTask | the Runnable to schedule as TimerTask |
---|
Create a new ScheduledTimerTask, with default one-time execution with the given delay.
timerTask | the Runnable to schedule as TimerTask |
---|---|
delay | the delay before starting the task for the first time (ms) |
Create a new ScheduledTimerTask.
timerTask | the Runnable to schedule as TimerTask |
---|---|
delay | the delay before starting the task for the first time (ms) |
period | the period between repeated task executions (ms) |
fixedRate | whether to schedule as fixed-rate execution |
Return the delay before starting the job for the first time.
Return the period between repeated task executions.
Return whether to schedule as fixed-rate execution.
Is this task only ever going to execute once?
true
if this task is only ever going to execute onceSet the delay before starting the task for the first time, in milliseconds. Default is 0, immediately starting the task after successful scheduling.
Set whether to schedule as fixed-rate execution, rather than fixed-delay execution. Default is "false", that is, fixed delay.
See Timer javadoc for details on those execution modes.
Set the period between repeated task executions, in milliseconds.
Default is -1, leading to one-time execution. In case of a positive value, the task will be executed repeatedly, with the given interval inbetween executions.
Note that the semantics of the period value vary between fixed-rate and fixed-delay execution.
Note: A period of 0 (for example as fixed delay) is not
supported, simply because java.util.Timer
itself does not
support it. Hence a value of 0 will be treated as one-time execution;
however, that value should never be specified explicitly in the first place!