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,
boolean defaultValue)
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.
|
static boolean |
isTemplate(String expression)
Check if the expression is a template
|
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) |
ExpressionRetryPolicy |
withBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) |
close, getMaxAttempts, open, registerThrowable, setMaxAttempts, toString
public 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, boolean defaultValue)
maxAttempts
- the max attemptsretryableExceptions
- the exceptionstraverseCauses
- true to examine causesexpressionString
- the expression.defaultValue
- the default actionpublic void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) throws org.springframework.beans.BeansException
setBeanFactory
in interface org.springframework.beans.factory.BeanFactoryAware
org.springframework.beans.BeansException
public ExpressionRetryPolicy withBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
public boolean canRetry(RetryContext context)
SimpleRetryPolicy
canRetry
in interface RetryPolicy
canRetry
in class SimpleRetryPolicy
context
- the current retry statusRetryPolicy.canRetry(org.springframework.retry.RetryContext)
public static boolean isTemplate(String expression)
expression
- the expression stringCopyright © 2022 SpringSource. All rights reserved.