|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RetryPolicy
A 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.
Method Summary | |
---|---|
boolean |
canRetry(RetryContext context)
|
void |
close(RetryContext context)
|
Object |
handleRetryExhausted(RetryContext context)
Handle an exhausted retry. |
RetryContext |
open(RetryCallback callback,
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 |
shouldRethrow(RetryContext context)
|
Method Detail |
---|
boolean canRetry(RetryContext context)
context
- the current retry status
boolean shouldRethrow(RetryContext context)
context
- the current context.
RetryContext open(RetryCallback callback, RetryContext parent)
callback
- the RetryCallback
that will execute the unit of
work for this retry.parent
- the parent context if we are in a nested retry.
RetryContext
object specific to this manager.void close(RetryContext context)
context
- a retry status created by the open(RetryCallback, RetryContext)
method of this manager.void registerThrowable(RetryContext context, Throwable throwable) throws TerminatedRetryException
context
- the current status object.
TerminatedRetryException
- if the status is set to terminate only.Object handleRetryExhausted(RetryContext context) throws ExhaustedRetryException
context
- the current retry context.
ExhaustedRetryException
- if there is no recovery path.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |