Class FixedBackOff
java.lang.Object
org.springframework.util.backoff.FixedBackOff
- All Implemented Interfaces:
- BackOff
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final longThe default recovery interval: 5000 ms = 5 seconds.static final longConstant value indicating an unlimited number of attempts.
- 
Constructor SummaryConstructorsConstructorDescriptionCreate an instance with an interval of 5000L ms and an unlimited number of attempts.FixedBackOff(long interval, long maxAttempts) Create an instance.
- 
Method SummaryModifier and TypeMethodDescriptionlongReturn the interval between two attempts in milliseconds.longReturn the maximum number of attempts in milliseconds.voidsetInterval(long interval) Set the interval between two attempts in milliseconds.voidsetMaxAttempts(long maxAttempts) Set the maximum number of attempts in milliseconds.start()Start a new back off execution.
- 
Field Details- 
DEFAULT_INTERVALpublic static final long DEFAULT_INTERVALThe default recovery interval: 5000 ms = 5 seconds.- See Also:
 
- 
UNLIMITED_ATTEMPTSpublic static final long UNLIMITED_ATTEMPTSConstant value indicating an unlimited number of attempts.- See Also:
 
 
- 
- 
Constructor Details- 
FixedBackOffpublic FixedBackOff()Create an instance with an interval of 5000L ms and an unlimited number of attempts.
- 
FixedBackOffpublic FixedBackOff(long interval, long maxAttempts) Create an instance.- Parameters:
- interval- the interval between two attempts
- maxAttempts- the maximum number of attempts
 
 
- 
- 
Method Details- 
setIntervalpublic void setInterval(long interval) Set the interval between two attempts in milliseconds.
- 
getIntervalpublic long getInterval()Return the interval between two attempts in milliseconds.
- 
setMaxAttemptspublic void setMaxAttempts(long maxAttempts) Set the maximum number of attempts in milliseconds.
- 
getMaxAttemptspublic long getMaxAttempts()Return the maximum number of attempts in milliseconds.
- 
startDescription copied from interface:BackOffStart a new back off execution.- Specified by:
- startin interface- BackOff
- Returns:
- a fresh BackOffExecutionready to be used
 
 
-