public abstract static class AbstractScheduledService.Scheduler extends Object
AbstractScheduledService should run its task.
Consider using the newFixedDelaySchedule(long, long, java.util.concurrent.TimeUnit) and newFixedRateSchedule(long, long, java.util.concurrent.TimeUnit) factory methods, these provide AbstractScheduledService.Scheduler instances for the common use case of running the service with a fixed schedule. If more flexibility is needed then consider subclassing AbstractScheduledService.CustomScheduler.
| Modifier and Type | Method and Description |
|---|---|
static AbstractScheduledService |
newFixedDelaySchedule(long initialDelay, long delay, TimeUnit
Returns a
AbstractScheduledService.Scheduler that schedules the task using the
ScheduledExecutorService method.
|
static AbstractScheduledService |
newFixedRateSchedule(long initialDelay, long period, TimeUnit
Returns a
AbstractScheduledService.Scheduler that schedules the task using the
ScheduledExecutorService method.
|
public static AbstractScheduledService.Scheduler newFixedDelaySchedule(long initialDelay, long delay, TimeUnit unit)
AbstractScheduledService.Scheduler that schedules the task using the
ScheduledExecutorService.scheduleWithFixedDelay(java.lang.Runnable, long, long, java.util.concurrent.TimeUnit) method.
initialDelay - the time to delay first execution
delay - the delay between the termination of one execution and the commencement of the next
unit - the time unit of the initialDelay and delay parameters
public static AbstractScheduledService.Scheduler newFixedRateSchedule(long initialDelay, long period, TimeUnit unit)
AbstractScheduledService.Scheduler that schedules the task using the
ScheduledExecutorService.scheduleAtFixedRate(java.lang.Runnable, long, long, java.util.concurrent.TimeUnit) method.
initialDelay - the time to delay first execution
period - the period between successive executions of the task
unit - the time unit of the initialDelay and period parameters