@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 and Description |
---|---|
protected static class |
AbstractScheduledService.CustomScheduler.Schedule
A value object that represents an absolute delay until a task should be invoked.
|
Constructor and Description |
---|
AbstractScheduledService.CustomScheduler() |
Modifier and Type | Method and Description |
---|---|
protected abstract AbstractScheduledService.CustomScheduler.Schedule |
getNextSchedule()
Calculates the time at which to next invoke the task.
|
newFixedDelaySchedule, newFixedRateSchedule
public AbstractScheduledService.CustomScheduler()
protected abstract AbstractScheduledService.CustomScheduler.Schedule getNextSchedule() throws 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()
.
Exception
Copyright © 2010-2013. All Rights Reserved.