public interface RetryOperations
RetryOperations
to execute
operations with configurable retry behaviour.Modifier and Type | Method and Description |
---|---|
<T,E extends Throwable> |
execute(RetryCallback<T,E> retryCallback)
Execute the supplied
RetryCallback with the configured retry semantics. |
<T,E extends Throwable> |
execute(RetryCallback<T,E> retryCallback,
RecoveryCallback<T> recoveryCallback)
Execute the supplied
RetryCallback with a fallback on exhausted retry to
the RecoveryCallback . |
<T,E extends Throwable> |
execute(RetryCallback<T,E> retryCallback,
RecoveryCallback<T> recoveryCallback,
RetryState retryState)
A stateful retry with a recovery path.
|
<T,E extends Throwable> |
execute(RetryCallback<T,E> retryCallback,
RetryState retryState)
A simple stateful retry.
|
<T,E extends Throwable> T execute(RetryCallback<T,E> retryCallback) throws E extends Throwable
RetryCallback
with the configured retry semantics. See
implementations for configuration details.T
- the return valueE
- the exception to throwretryCallback
- the RetryCallback
RetryCallback
upon successful invocation.E
- any Exception
raised by the RetryCallback
upon
unsuccessful retry.E
- the exception thrownE extends Throwable
<T,E extends Throwable> T execute(RetryCallback<T,E> retryCallback, RecoveryCallback<T> recoveryCallback) throws E extends Throwable
RetryCallback
with a fallback on exhausted retry to
the RecoveryCallback
. See implementations for configuration details.T
- the type to returnE
- the type of the exceptionrecoveryCallback
- the RecoveryCallback
retryCallback
- the RetryCallback
RecoveryCallback
uponRetryCallback
upon successful invocation,
and that returned by the RecoveryCallback
otherwise.E
- any Exception
raised by the unsuccessful retry.E extends Throwable
<T,E extends Throwable> T execute(RetryCallback<T,E> retryCallback, RetryState retryState) throws E extends Throwable, ExhaustedRetryException
RetryCallback
with a target
object for the attempt identified by the DefaultRetryState
. Exceptions
thrown by the callback are always propagated immediately so the state is required
to be able to identify the previous attempt, if there is one - hence the state is
required. Normal patterns would see this method being used inside a transaction,
where the callback might invalidate the transaction if it fails.
See implementations for configuration details.T
- the type of the return valueE
- the type of the exception to returnretryCallback
- the RetryCallback
retryState
- the RetryState
RetryCallback
upon successful invocation,
and that returned by the RecoveryCallback
otherwise.E
- any Exception
raised by the RecoveryCallback
.ExhaustedRetryException
- if the last attempt for this state has already been
reachedE extends Throwable
<T,E extends Throwable> T execute(RetryCallback<T,E> retryCallback, RecoveryCallback<T> recoveryCallback, RetryState retryState) throws E extends Throwable
RetryCallback
with a fallback on exhausted retry to the RecoveryCallback
and a target
object for the retry attempt identified by the DefaultRetryState
.T
- the return value typeE
- the exception typerecoveryCallback
- the RecoveryCallback
retryState
- the RetryState
retryCallback
- the RetryCallback
RetryCallback
upon successful invocation,
and that returned by the RecoveryCallback
otherwise.E
- any Exception
raised by the RecoveryCallback
upon
unsuccessful retry.E extends Throwable
execute(RetryCallback, RetryState)
Copyright © 2021 SpringSource. All rights reserved.