public interface RetryPolicy extends Serializable
RetryPolicy
is responsible for allocating and managing resources
needed by RetryOperations
. The RetryPolicy
allows retry
operations to be aware of their context. Context can be internal to the retry
framework, e.g. to support nested retries. Context can also be external, and
the RetryPolicy
provides a uniform API for a range of different
platforms for the external context.Modifier and Type | Method and Description |
---|---|
boolean |
canRetry(RetryContext context) |
void |
close(RetryContext context) |
RetryContext |
open(RetryContext parent)
Acquire resources needed for the retry operation.
|
void |
registerThrowable(RetryContext context,
Throwable throwable)
Called once per retry attempt, after the callback fails.
|
boolean canRetry(RetryContext context)
context
- the current retry statusRetryContext open(RetryContext parent)
parent
- the parent context if we are in a nested retry.RetryContext
object specific to this policy.void close(RetryContext context)
context
- a retry status created by the
open(RetryContext)
method of this policy.void registerThrowable(RetryContext context, Throwable throwable)
context
- the current status object.throwable
- the exception to throwCopyright © 2018 SpringSource. All rights reserved.