@Beta public abstract static class AbstractScheduledService.CustomScheduler extends AbstractScheduledService.Scheduler
AbstractScheduledService.Scheduler that provides a convenient way for the AbstractScheduledService to
use a dynamically changing schedule. After every execution of the task, assuming it hasn't been
cancelled, the getNextSchedule() method will be called.| Modifier and Type | Class | Description |
|---|---|---|
protected static class |
AbstractScheduledService.CustomScheduler.Schedule |
A value object that represents an absolute delay until a task should be invoked.
|
| Constructor | Description |
|---|---|
CustomScheduler() |
| Modifier and Type | Method | Description |
|---|---|---|
protected abstract AbstractScheduledService.CustomScheduler.Schedule |
getNextSchedule() |
Calculates the time at which to next invoke the task.
|
newFixedDelaySchedule, newFixedRateScheduleprotected abstract AbstractScheduledService.CustomScheduler.Schedule getNextSchedule() throws java.lang.Exception
This is guaranteed to be called immediately after the task has completed an iteration and
on the same thread as the previous execution of AbstractScheduledService.runOneIteration().
java.lang.Exception