| java.lang.Object org.springframework.scheduling.timer.ScheduledTimerTask
Constructor Summary | |
public | ScheduledTimerTask() Create a new ScheduledTimerTask,
to be populated via bean properties. | public | ScheduledTimerTask(TimerTask timerTask) Create a new ScheduledTimerTask, with default
one-time execution without delay. | public | ScheduledTimerTask(TimerTask timerTask, long delay) Create a new ScheduledTimerTask, with default
one-time execution with the given delay. | public | ScheduledTimerTask(TimerTask timerTask, long delay, long period, boolean fixedRate) Create a new ScheduledTimerTask. | public | ScheduledTimerTask(Runnable timerTask) Create a new ScheduledTimerTask, with default
one-time execution without delay. | public | ScheduledTimerTask(Runnable timerTask, long delay) Create a new ScheduledTimerTask, with default
one-time execution with the given delay. | public | ScheduledTimerTask(Runnable timerTask, long delay, long period, boolean fixedRate) Create a new ScheduledTimerTask. |
Method Summary | |
public long | getDelay() Return the delay before starting the job for the first time. | public long | getPeriod() Return the period between repeated task executions. | public TimerTask | getTimerTask() Return the TimerTask to schedule. | public boolean | isFixedRate() Return whether to schedule as fixed-rate execution. | public boolean | isOneTimeTask() | public void | setDelay(long delay) Set the delay before starting the task for the first time,
in milliseconds. | public void | setFixedRate(boolean fixedRate) Set whether to schedule as fixed-rate execution, rather than
fixed-delay execution. | public void | setPeriod(long period) Set the period between repeated task executions, in milliseconds.
Default is -1, leading to one-time execution. | public void | setRunnable(Runnable timerTask) Set the Runnable to schedule as TimerTask. | public void | setTimerTask(TimerTask timerTask) Set the TimerTask to schedule. |
ScheduledTimerTask | public ScheduledTimerTask(TimerTask timerTask)(Code) | | Create a new ScheduledTimerTask, with default
one-time execution without delay.
Parameters: timerTask - the TimerTask to schedule |
ScheduledTimerTask | public ScheduledTimerTask(TimerTask timerTask, long delay)(Code) | | Create a new ScheduledTimerTask, with default
one-time execution with the given delay.
Parameters: timerTask - the TimerTask to schedule Parameters: delay - the delay before starting the task for the first time (ms) |
ScheduledTimerTask | public ScheduledTimerTask(TimerTask timerTask, long delay, long period, boolean fixedRate)(Code) | | Create a new ScheduledTimerTask.
Parameters: timerTask - the TimerTask to schedule Parameters: delay - the delay before starting the task for the first time (ms) Parameters: period - the period between repeated task executions (ms) Parameters: fixedRate - whether to schedule as fixed-rate execution |
ScheduledTimerTask | public ScheduledTimerTask(Runnable timerTask)(Code) | | Create a new ScheduledTimerTask, with default
one-time execution without delay.
Parameters: timerTask - the Runnable to schedule as TimerTask |
ScheduledTimerTask | public ScheduledTimerTask(Runnable timerTask, long delay)(Code) | | Create a new ScheduledTimerTask, with default
one-time execution with the given delay.
Parameters: timerTask - the Runnable to schedule as TimerTask Parameters: delay - the delay before starting the task for the first time (ms) |
ScheduledTimerTask | public ScheduledTimerTask(Runnable timerTask, long delay, long period, boolean fixedRate)(Code) | | Create a new ScheduledTimerTask.
Parameters: timerTask - the Runnable to schedule as TimerTask Parameters: delay - the delay before starting the task for the first time (ms) Parameters: period - the period between repeated task executions (ms) Parameters: fixedRate - whether to schedule as fixed-rate execution |
getDelay | public long getDelay()(Code) | | Return the delay before starting the job for the first time.
|
getPeriod | public long getPeriod()(Code) | | Return the period between repeated task executions.
|
getTimerTask | public TimerTask getTimerTask()(Code) | | Return the TimerTask to schedule.
|
isFixedRate | public boolean isFixedRate()(Code) | | Return whether to schedule as fixed-rate execution.
|
isOneTimeTask | public boolean isOneTimeTask()(Code) | | Is this task only ever going to execute once?
true if this task is only ever going to execute once See Also: ScheduledTimerTask.getPeriod() |
setDelay | public void setDelay(long delay)(Code) | | Set the delay before starting the task for the first time,
in milliseconds. Default is 0, immediately starting the
task after successful scheduling.
|
setPeriod | public void setPeriod(long period)(Code) | | 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!
See Also: ScheduledTimerTask.setFixedRate See Also: ScheduledTimerTask.isOneTimeTask() See Also: java.util.Timer.schedule(TimerTasklonglong) |
setTimerTask | public void setTimerTask(TimerTask timerTask)(Code) | | Set the TimerTask to schedule.
|
|
|