Uses of Interface
org.springframework.retry.RetryContext
Package
Description
Infrastructure implementations of retry concerns.
Infrastructure implementations of retry backoff concerns.
Infrastructure implementations of retry context concerns.
Infrastructure implementations of retry interceptor concerns.
Infrastructure implementations of retry policy concerns.
Infrastructure implementations of retry support concerns.
-
Uses of RetryContext in org.springframework.retry
Modifier and TypeMethodDescriptionRetryContext.getParent()
Accessor for the parent context if retry blocks are nested.RetryPolicy.open
(RetryContext parent) Acquire resources needed for the retry operation.Modifier and TypeMethodDescriptionboolean
RetryPolicy.canRetry
(RetryContext context) default <T,
E extends Throwable>
voidRetryListener.close
(RetryContext context, RetryCallback<T, E> callback, Throwable throwable) Called after the final attempt (successful or not).void
RetryPolicy.close
(RetryContext context) RetryCallback.doWithRetry
(RetryContext context) Execute an operation with retry semantics.default <T,
E extends Throwable>
voidRetryListener.onError
(RetryContext context, RetryCallback<T, E> callback, Throwable throwable) Called after every unsuccessful attempt at a retry.default <T,
E extends Throwable>
voidRetryListener.onSuccess
(RetryContext context, RetryCallback<T, E> callback, T result) Called after a successful attempt; allow the listener to throw a new exception to cause a retry (according to the retry policy), based on the result returned by theRetryCallback.doWithRetry(RetryContext)
default <T,
E extends Throwable>
booleanRetryListener.open
(RetryContext context, RetryCallback<T, E> callback) Called before the first attempt in a retry.RetryPolicy.open
(RetryContext parent) Acquire resources needed for the retry operation.RecoveryCallback.recover
(RetryContext context) void
RetryPolicy.registerThrowable
(RetryContext context, Throwable throwable) Called once per retry attempt, after the callback fails. -
Uses of RetryContext in org.springframework.retry.backoff
Modifier and TypeMethodDescriptionBackOffPolicy.start
(RetryContext context) Start a new block of back off operations.ExponentialBackOffPolicy.start
(RetryContext context) Returns a new instance ofBackOffContext
with the configured properties.ExponentialRandomBackOffPolicy.start
(RetryContext context) Returns a new instance ofBackOffContext
, seeded with this policies settings.StatelessBackOffPolicy.start
(RetryContext status) Returns 'null
'. -
Uses of RetryContext in org.springframework.retry.context
-
Uses of RetryContext in org.springframework.retry.listener
Modifier and TypeMethodDescription<T,
E extends Throwable>
voidMethodInvocationRetryListenerSupport.close
(RetryContext context, RetryCallback<T, E> callback, Throwable throwable) <T,
E extends Throwable>
voidRetryListenerSupport.close
(RetryContext context, RetryCallback<T, E> callback, Throwable throwable) Deprecated, for removal: This API element is subject to removal in a future version.protected <T,
E extends Throwable>
voidMethodInvocationRetryListenerSupport.doClose
(RetryContext context, MethodInvocationRetryCallback<T, E> callback, Throwable throwable) Called after the final attempt (successful or not).protected <T,
E extends Throwable>
voidMethodInvocationRetryListenerSupport.doOnError
(RetryContext context, MethodInvocationRetryCallback<T, E> callback, Throwable throwable) Called after every unsuccessful attempt at a retry.protected <T,
E extends Throwable>
voidMethodInvocationRetryListenerSupport.doOnSuccess
(RetryContext context, MethodInvocationRetryCallback<T, E> callback, T result) Called after a successful attempt; allow the listener to throw a new exception to cause a retry (according to the retry policy), based on the result returned by theRetryCallback.doWithRetry(RetryContext)
protected <T,
E extends Throwable>
booleanMethodInvocationRetryListenerSupport.doOpen
(RetryContext context, MethodInvocationRetryCallback<T, E> callback) Called before the first attempt in a retry.<T,
E extends Throwable>
voidMethodInvocationRetryListenerSupport.onError
(RetryContext context, RetryCallback<T, E> callback, Throwable throwable) <T,
E extends Throwable>
voidRetryListenerSupport.onError
(RetryContext context, RetryCallback<T, E> callback, Throwable throwable) Deprecated, for removal: This API element is subject to removal in a future version.<T,
E extends Throwable>
voidMethodInvocationRetryListenerSupport.onSuccess
(RetryContext context, RetryCallback<T, E> callback, T result) <T,
E extends Throwable>
booleanMethodInvocationRetryListenerSupport.open
(RetryContext context, RetryCallback<T, E> callback) <T,
E extends Throwable>
booleanRetryListenerSupport.open
(RetryContext context, RetryCallback<T, E> callback) Deprecated, for removal: This API element is subject to removal in a future version. -
Uses of RetryContext in org.springframework.retry.policy
Modifier and TypeMethodDescriptionBinaryExceptionClassifierRetryPolicy.open
(RetryContext parent) CircuitBreakerRetryPolicy.open
(RetryContext parent) CompositeRetryPolicy.open
(RetryContext parent) Creates a new context that copies the existing policies and keeps a list of the contexts from each one.ExceptionClassifierRetryPolicy.open
(RetryContext parent) Create an active context that proxies a retry policy by choosing a target from the policy map.MaxAttemptsRetryPolicy.open
(RetryContext parent) Get a status object that can be used to track the current operation according to this policy.NeverRetryPolicy.open
(RetryContext parent) Return a context that can respond to early termination requests, but does nothing else.PredicateRetryPolicy.open
(RetryContext parent) SimpleRetryPolicy.open
(RetryContext parent) Get a status object that can be used to track the current operation according to this policy.TimeoutRetryPolicy.open
(RetryContext parent) Modifier and TypeMethodDescriptionboolean
AlwaysRetryPolicy.canRetry
(RetryContext context) Always returns true.boolean
BinaryExceptionClassifierRetryPolicy.canRetry
(RetryContext context) boolean
CircuitBreakerRetryPolicy.canRetry
(RetryContext context) boolean
CompositeRetryPolicy.canRetry
(RetryContext context) Delegate to the policies that were in operation when the context was created.boolean
ExceptionClassifierRetryPolicy.canRetry
(RetryContext context) Delegate to the policy currently activated in the context.boolean
ExpressionRetryPolicy.canRetry
(RetryContext context) boolean
MaxAttemptsRetryPolicy.canRetry
(RetryContext context) Test for retryable operation based on the status.boolean
NeverRetryPolicy.canRetry
(RetryContext context) Returns false after the first exception.boolean
PredicateRetryPolicy.canRetry
(RetryContext context) boolean
SimpleRetryPolicy.canRetry
(RetryContext context) Test for retryable operation based on the status.boolean
TimeoutRetryPolicy.canRetry
(RetryContext context) Only permits a retry if the timeout has not expired.void
BinaryExceptionClassifierRetryPolicy.close
(RetryContext status) void
CircuitBreakerRetryPolicy.close
(RetryContext context) void
CompositeRetryPolicy.close
(RetryContext context) Delegate to the policies that were in operation when the context was created.void
ExceptionClassifierRetryPolicy.close
(RetryContext context) Delegate to the policy currently activated in the context.void
MaxAttemptsRetryPolicy.close
(RetryContext status) void
NeverRetryPolicy.close
(RetryContext context) Do nothing.void
PredicateRetryPolicy.close
(RetryContext status) void
SimpleRetryPolicy.close
(RetryContext status) void
TimeoutRetryPolicy.close
(RetryContext context) BinaryExceptionClassifierRetryPolicy.open
(RetryContext parent) CircuitBreakerRetryPolicy.open
(RetryContext parent) CompositeRetryPolicy.open
(RetryContext parent) Creates a new context that copies the existing policies and keeps a list of the contexts from each one.ExceptionClassifierRetryPolicy.open
(RetryContext parent) Create an active context that proxies a retry policy by choosing a target from the policy map.MaxAttemptsRetryPolicy.open
(RetryContext parent) Get a status object that can be used to track the current operation according to this policy.NeverRetryPolicy.open
(RetryContext parent) Return a context that can respond to early termination requests, but does nothing else.PredicateRetryPolicy.open
(RetryContext parent) SimpleRetryPolicy.open
(RetryContext parent) Get a status object that can be used to track the current operation according to this policy.TimeoutRetryPolicy.open
(RetryContext parent) void
MapRetryContextCache.put
(Object key, RetryContext context) void
RetryContextCache.put
(Object key, RetryContext context) void
SoftReferenceMapRetryContextCache.put
(Object key, RetryContext context) void
BinaryExceptionClassifierRetryPolicy.registerThrowable
(RetryContext context, Throwable throwable) void
CircuitBreakerRetryPolicy.registerThrowable
(RetryContext context, Throwable throwable) void
CompositeRetryPolicy.registerThrowable
(RetryContext context, Throwable throwable) Delegate to the policies that were in operation when the context was created.void
ExceptionClassifierRetryPolicy.registerThrowable
(RetryContext context, Throwable throwable) Delegate to the policy currently activated in the context.void
MaxAttemptsRetryPolicy.registerThrowable
(RetryContext context, Throwable throwable) Update the status with another attempted retry and the latest exception.void
NeverRetryPolicy.registerThrowable
(RetryContext context, Throwable throwable) Make the throwable available for downstream use through the context.void
PredicateRetryPolicy.registerThrowable
(RetryContext context, Throwable throwable) void
SimpleRetryPolicy.registerThrowable
(RetryContext context, Throwable throwable) Update the status with another attempted retry and the latest exception.void
TimeoutRetryPolicy.registerThrowable
(RetryContext context, Throwable throwable) -
Uses of RetryContext in org.springframework.retry.stats
Modifier and TypeMethodDescription<T,
E extends Throwable>
voidStatisticsListener.close
(RetryContext context, RetryCallback<T, E> callback, Throwable throwable) <T,
E extends Throwable>
voidStatisticsListener.onError
(RetryContext context, RetryCallback<T, E> callback, Throwable throwable) -
Uses of RetryContext in org.springframework.retry.support
Modifier and TypeMethodDescriptionstatic RetryContext
RetrySynchronizationManager.clear()
Clear the current context at the end of a batch - should only be used byRetryOperations
implementations.static RetryContext
RetrySynchronizationManager.getContext()
Public accessor for the locally enclosingRetryContext
.protected RetryContext
RetryTemplate.open
(RetryPolicy retryPolicy, RetryState state) Delegate to theRetryPolicy
having checked in the cache for an existing value if the state is not null.static RetryContext
RetrySynchronizationManager.register
(RetryContext context) Method for registering a context - should only be used byRetryOperations
implementations to ensure thatRetrySynchronizationManager.getContext()
always returns the correct value.Modifier and TypeMethodDescriptionprotected boolean
RetryTemplate.canRetry
(RetryPolicy retryPolicy, RetryContext context) Decide whether to proceed with the ongoing retry attempt.<T,
E extends Throwable>
voidMetricsRetryListener.close
(RetryContext context, RetryCallback<T, E> callback, Throwable throwable) protected void
RetryTemplate.close
(RetryPolicy retryPolicy, RetryContext context, RetryState state, boolean succeeded) Clean up the cache if necessary and close the context provided (if the flag indicates that processing was successful).protected <T> T
RetryTemplate.handleRetryExhausted
(RecoveryCallback<T> recoveryCallback, RetryContext context, RetryState state) Actions to take after final attempt has failed.<T,
E extends Throwable>
booleanMetricsRetryListener.open
(RetryContext context, RetryCallback<T, E> callback) static RetryContext
RetrySynchronizationManager.register
(RetryContext context) Method for registering a context - should only be used byRetryOperations
implementations to ensure thatRetrySynchronizationManager.getContext()
always returns the correct value.protected void
RetryTemplate.registerThrowable
(RetryPolicy retryPolicy, RetryState state, RetryContext context, Throwable e) protected <E extends Throwable>
voidRetryTemplate.rethrow
(RetryContext context, String message, boolean wrap) protected boolean
RetryTemplate.shouldRethrow
(RetryPolicy retryPolicy, RetryContext context, RetryState state) Extension point for subclasses to decide on behaviour after catching an exception in aRetryCallback
.Modifier and TypeMethodDescriptionvoid
MetricsRetryListener.setCustomTagsProvider
(Function<RetryContext, Iterable<io.micrometer.core.instrument.Tag>> customTagsProvider) Supply aFunction
to build additional tags for all the timers based on theRetryContext
.