Polish resilience features

This commit is contained in:
Sam Brannen
2025-10-09 17:22:53 +02:00
parent 670effa02b
commit 58940794cf
4 changed files with 23 additions and 6 deletions
@@ -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");
@@ -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()
*/