Class StatelessBackOffPolicy
java.lang.Object
org.springframework.retry.backoff.StatelessBackOffPolicy
- All Implemented Interfaces:
BackOffPolicy
- Direct Known Subclasses:
FixedBackOffPolicy
,NoBackOffPolicy
,UniformRandomBackOffPolicy
Simple base class for
BackOffPolicy
implementations that maintain no state
across invocations.- Author:
- Rob Harrop, Dave Syer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal void
backOff
(BackOffContext backOffContext) Delegates directly to thedoBackOff()
method without passing on theBackOffContext
argument which is not needed for stateless implementations.protected abstract void
Sub-classes should implement this method to perform the actual back off.start
(RetryContext status) Returns 'null
'.
-
Constructor Details
-
StatelessBackOffPolicy
public StatelessBackOffPolicy()
-
-
Method Details
-
backOff
Delegates directly to thedoBackOff()
method without passing on theBackOffContext
argument which is not needed for stateless implementations.- Specified by:
backOff
in interfaceBackOffPolicy
- Parameters:
backOffContext
- theBackOffContext
- Throws:
BackOffInterruptedException
- if the attempt at back off is interrupted.
-
start
Returns 'null
'. Subclasses can add behaviour, e.g. initial sleep before first attempt.- Specified by:
start
in interfaceBackOffPolicy
- Parameters:
status
- theRetryContext
context, which might contain information that we can use to decide how to proceed.- Returns:
- the implementation-specific
BackOffContext
or 'null
'.
-
doBackOff
Sub-classes should implement this method to perform the actual back off.- Throws:
BackOffInterruptedException
- if the backoff is interrupted
-