Interface Schedule
-
- All Known Implementing Classes:
CronSchedule
,IntervalSchedule
public interface Schedule
Used withPeriodicExecutor
to control the schedule for when jobs execute.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description long
firstExecution()
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.
-
-
-
Method Detail
-
firstExecution
long firstExecution()
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.- Returns:
- start time for new job, in system clock millis
-
nextExecution
long nextExecution(long previousExecution)
Computes the next execution time for a job.- 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
-
-