public class ExpressionRetryPolicy extends SimpleRetryPolicy implements org.springframework.beans.factory.BeanFactoryAware
SimpleRetryPolicy that delegates to super.canRetry() and,
if true, further evaluates an expression against the last thrown exception.DEFAULT_MAX_ATTEMPTS| Constructor and Description |
|---|
ExpressionRetryPolicy(org.springframework.expression.Expression expression)
Construct an instance with the provided
Expression. |
ExpressionRetryPolicy(int maxAttempts,
Map<Class<? extends Throwable>,Boolean> retryableExceptions,
boolean traverseCauses,
org.springframework.expression.Expression expression)
Construct an instance with the provided
Expression. |
ExpressionRetryPolicy(int maxAttempts,
Map<Class<? extends Throwable>,Boolean> retryableExceptions,
boolean traverseCauses,
String expressionString)
Construct an instance with the provided expression.
|
ExpressionRetryPolicy(String expressionString)
Construct an instance with the provided expression.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canRetry(RetryContext context)
Test for retryable operation based on the status.
|
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) |
ExpressionRetryPolicy |
withBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) |
close, getMaxAttempts, open, registerThrowable, setMaxAttempts, toStringpublic ExpressionRetryPolicy(org.springframework.expression.Expression expression)
Expression.expression - the expressionpublic ExpressionRetryPolicy(String expressionString)
expressionString - the expression.public ExpressionRetryPolicy(int maxAttempts,
Map<Class<? extends Throwable>,Boolean> retryableExceptions,
boolean traverseCauses,
org.springframework.expression.Expression expression)
Expression.maxAttempts - the max attemptsretryableExceptions - the exceptionstraverseCauses - true to examine causesexpression - the expressionpublic ExpressionRetryPolicy(int maxAttempts,
Map<Class<? extends Throwable>,Boolean> retryableExceptions,
boolean traverseCauses,
String expressionString)
maxAttempts - the max attemptsretryableExceptions - the exceptionstraverseCauses - true to examine causesexpressionString - the expression.public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
throws org.springframework.beans.BeansException
setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAwareorg.springframework.beans.BeansExceptionpublic ExpressionRetryPolicy withBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
public boolean canRetry(RetryContext context)
SimpleRetryPolicycanRetry in interface RetryPolicycanRetry in class SimpleRetryPolicycontext - the current retry statusRetryPolicy.canRetry(org.springframework.retry.RetryContext)Copyright © 2018 SpringSource. All rights reserved.