Package org.springframework.retry
Interface RetryCallback<T,E extends Throwable>
- Type Parameters:
T
- the type of object returned by the callbackE
- the type of exception it declares may be thrown
- All Known Implementing Classes:
MethodInvocationRetryCallback
public interface RetryCallback<T,E extends Throwable>
Callback interface for an operation that can be retried using a
RetryOperations
.- Author:
- Rob Harrop, Dave Syer, Artem Bilan
-
Method Summary
Modifier and TypeMethodDescriptiondoWithRetry
(RetryContext context) Execute an operation with retry semantics.default String
getLabel()
A logical identifier for this callback to distinguish retries around business operations.
-
Method Details
-
doWithRetry
Execute an operation with retry semantics. Operations should generally be idempotent, but implementations may choose to implement compensation semantics when an operation is retried.- Parameters:
context
- the current retry context.- Returns:
- the result of the successful operation.
- Throws:
E
- of type E if processing fails
-
getLabel
A logical identifier for this callback to distinguish retries around business operations.- Returns:
- the identifier for this callback.
- Since:
- 2.0.6
-