Class AbstractScheduledService.Scheduler
-
- com.google.common.util.concurrent.AbstractScheduledService.Scheduler
-
- Direct Known Subclasses:
AbstractScheduledService.CustomScheduler
- Enclosing class:
- AbstractScheduledService
public abstract static class AbstractScheduledService.Scheduler extends
A scheduler defines the policy for how theAbstractScheduledService
should run its task.Consider using the
newFixedDelaySchedule(java.time.Duration, java.time.Duration)
andnewFixedRateSchedule(java.time.Duration, java.time.Duration)
factory methods, these provideAbstractScheduledService.Scheduler
instances for the common use case of running the service with a fixed schedule. If more flexibility is needed then consider subclassingAbstractScheduledService.CustomScheduler
.- Since:
- 11.0
- Author:
- Luke Sandberg
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static AbstractScheduledService.Scheduler
newFixedDelaySchedule(long initialDelay, long delay, unit)
Returns a method.static AbstractScheduledService.Scheduler
initialDelay, delay)
Returns a method.static AbstractScheduledService.Scheduler
newFixedRateSchedule(long initialDelay, long period, unit)
Returns a method.static AbstractScheduledService.Scheduler
initialDelay, period)
Returns a method.
-
-
-
Method Detail
-
newFixedDelaySchedule
public static initialDelay, delay)
Returns a method.- Parameters:
initialDelay
- the time to delay first executiondelay
- the delay between the termination of one execution and the commencement of the next- Since:
- 28.0
-
newFixedDelaySchedule
public static AbstractScheduledService.Scheduler newFixedDelaySchedule(long initialDelay, long delay, unit)
Returns a method.- Parameters:
initialDelay
- the time to delay first executiondelay
- the delay between the termination of one execution and the commencement of the nextunit
- the time unit of the initialDelay and delay parameters
-
newFixedRateSchedule
public static initialDelay, period)
Returns a method.- Parameters:
initialDelay
- the time to delay first executionperiod
- the period between successive executions of the task- Since:
- 28.0
-
newFixedRateSchedule
public static AbstractScheduledService.Scheduler newFixedRateSchedule(long initialDelay, long period, unit)
Returns a method.- Parameters:
initialDelay
- the time to delay first executionperiod
- the period between successive executions of the taskunit
- the time unit of the initialDelay and period parameters
-
-