Class IntervalSchedule
java.lang.Object
org.apache.tapestry5.ioc.services.cron.IntervalSchedule
- All Implemented Interfaces:
Schedule
A very simple schedule, that simply executes the desired job at fixed intervals.
- Since:
- 5.3
-
Constructor Summary
ConstructorsConstructorDescriptionIntervalSchedule
(long interval) Interval at which the schedule should execute jobs. -
Method Summary
Modifier and TypeMethodDescriptionlong
For a newly created job, what is the start time for the job.long
nextExecution
(long previousExecution) Computes the next execution time for a job.
-
Constructor Details
-
IntervalSchedule
Interval at which the schedule should execute jobs. The first execution is delayed from current time by the interval as well.- Parameters:
interval
- in milliseconds
-
-
Method Details
-
firstExecution
Description copied from interface:Schedule
For a newly created job, what is the start time for the job. Often, the current clock time is returned, to start a job as soon as possible.- Specified by:
firstExecution
in interfaceSchedule
- Returns:
- start time for new job, in system clock millis
-
nextExecution
Description copied from interface:Schedule
Computes the next execution time for a job.- Specified by:
nextExecution
in interfaceSchedule
- Parameters:
previousExecution
- time of previous execution (in system clock millis)- Returns:
- time of next execution (in system clock millis) or a value <= 0 to cancel the job's execution
-