@ThreadSafe
public class ExponentialBackOffTrigger
extends java.lang.Object
implements org.springframework.scheduling.Trigger
Modifier and Type | Class and Description |
---|---|
static class |
ExponentialBackOffTrigger.DelayType
How the delay is calculated.
|
Constructor and Description |
---|
ExponentialBackOffTrigger(ExponentialBackOffTrigger.DelayType delayType,
long minDelay,
long maxDelay,
float factor)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
java.util.Date |
nextExecutionTime(org.springframework.scheduling.TriggerContext triggerContext) |
void |
reset()
Reset the delay to the minimum given at construction time.
|
public ExponentialBackOffTrigger(ExponentialBackOffTrigger.DelayType delayType, long minDelay, long maxDelay, float factor)
delayType
- type of delayminDelay
- minimum delay in millisecondsmaxDelay
- maximum delay in millisecondsfactor
- multiplier factor to grow the delayjava.lang.IllegalArgumentException
- if the minimum delay is smaller than 1, the max delay is smaller than the
minimum, or the factor is not positive.public java.util.Date nextExecutionTime(org.springframework.scheduling.TriggerContext triggerContext)
nextExecutionTime
in interface org.springframework.scheduling.Trigger
public void reset()