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
- public void setPolicies(RetryPolicy[] policies)
policies
- public boolean canRetry(RetryContext context)
canRetry
in interface RetryPolicy
context
- the current retry statusRetryPolicy.canRetry(org.springframework.retry.RetryContext)
public void close(RetryContext context)
close
in interface RetryPolicy
context
- a retry status created by the
RetryPolicy.open(RetryContext)
method of this manager.RetryPolicy.close(org.springframework.retry.RetryContext)
public RetryContext open(RetryContext parent)
open
in interface RetryPolicy
parent
- the parent context if we are in a nested retry.RetryContext
object specific to this manager.RetryPolicy.open(RetryContext)
public void registerThrowable(RetryContext context, Throwable throwable)
registerThrowable
in interface RetryPolicy
context
- the current status object.RetryPolicy.close(org.springframework.retry.RetryContext)
Copyright © 2014 SpringSource. All rights reserved.