mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Polish resilience features
This commit is contained in:
+1
-1
@@ -82,7 +82,7 @@ public class ConcurrencyLimitBeanPostProcessor extends AbstractBeanFactoryAwareA
|
||||
Object target = invocation.getThis();
|
||||
Class<?> targetClass = (target != null ? target.getClass() : method.getDeclaringClass());
|
||||
if (target == null && invocation instanceof ProxyMethodInvocation methodInvocation) {
|
||||
// Allow validation for AOP proxy without a target
|
||||
// Support concurrency throttling for AOP proxy without a target
|
||||
target = methodInvocation.getProxy();
|
||||
}
|
||||
Assert.state(target != null, "Target must not be null");
|
||||
|
||||
+9
-3
@@ -64,6 +64,8 @@ public @interface Retryable {
|
||||
/**
|
||||
* Applicable exception types to attempt a retry for. This attribute
|
||||
* allows for the convenient specification of assignable exception types.
|
||||
* <p>This can optionally be combined with {@link #excludes() excludes} or
|
||||
* a custom {@link #predicate() predicate}.
|
||||
* <p>The default is empty, leading to a retry attempt for any exception.
|
||||
* @see #excludes()
|
||||
* @see #predicate()
|
||||
@@ -74,6 +76,8 @@ public @interface Retryable {
|
||||
/**
|
||||
* Non-applicable exception types to avoid a retry for. This attribute
|
||||
* allows for the convenient specification of assignable exception types.
|
||||
* <p>This can optionally be combined with {@link #includes() includes} or
|
||||
* a custom {@link #predicate() predicate}.
|
||||
* <p>The default is empty, leading to a retry attempt for any exception.
|
||||
* @see #includes()
|
||||
* @see #predicate()
|
||||
@@ -81,12 +85,14 @@ public @interface Retryable {
|
||||
Class<? extends Throwable>[] excludes() default {};
|
||||
|
||||
/**
|
||||
* A predicate for filtering applicable exceptions for which
|
||||
* an invocation can be retried.
|
||||
* <p>The default is a retry attempt for any exception.
|
||||
* A predicate for filtering applicable exceptions for which an invocation can
|
||||
* be retried.
|
||||
* <p>A specified {@link MethodRetryPredicate} implementation will be instantiated
|
||||
* per method. It can use dependency injection at the constructor level or through
|
||||
* autowiring annotations, in case it needs access to other beans or facilities.
|
||||
* <p>This can optionally be combined with {@link #includes() includes} or
|
||||
* {@link #excludes() excludes}.
|
||||
* <p>The default is a retry attempt for any exception.
|
||||
* @see #includes()
|
||||
* @see #excludes()
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user