public class CompositeRetryPolicy extends Object implements RetryPolicy
RetryPolicy that composes a list of other policies and delegates
calls to them in order.| Constructor and Description |
|---|
CompositeRetryPolicy() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canRetry(RetryContext context)
Delegate to the policies that were in operation when the context was
created.
|
void |
close(RetryContext context)
Delegate to the policies that were in operation when the context was
created.
|
RetryContext |
open(RetryContext parent)
Creates a new context that copies the existing policies and keeps a list
of the contexts from each one.
|
void |
registerThrowable(RetryContext context,
Throwable throwable)
Delegate to the policies that were in operation when the context was
created.
|
void |
setOptimistic(boolean optimistic)
Setter for optimistic.
|
void |
setPolicies(RetryPolicy[] policies)
Setter for policies.
|
public void setOptimistic(boolean optimistic)
optimistic - should this retry policy be optimisticpublic void setPolicies(RetryPolicy[] policies)
policies - the RetryPolicy policiespublic boolean canRetry(RetryContext context)
canRetry in interface RetryPolicycontext - the RetryContextRetryPolicy.canRetry(org.springframework.retry.RetryContext)public void close(RetryContext context)
close in interface RetryPolicycontext - the RetryContextRetryPolicy.close(org.springframework.retry.RetryContext)public RetryContext open(RetryContext parent)
open in interface RetryPolicyparent - the parent context if we are in a nested retry.RetryContext object specific to this policy.RetryPolicy.open(RetryContext)public void registerThrowable(RetryContext context, Throwable throwable)
registerThrowable in interface RetryPolicycontext - the current status object.throwable - the exception to throwRetryPolicy.close(org.springframework.retry.RetryContext)Copyright © 2018 SpringSource. All rights reserved.