mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-17 16:39:29 +00:00
Polish @Retryable Javadoc and internals
This commit is contained in:
@@ -118,7 +118,6 @@ public abstract class AbstractRetryInterceptor implements MethodInterceptor {
|
||||
}
|
||||
@Override
|
||||
public String getName() {
|
||||
Object target = invocation.getThis();
|
||||
return ClassUtils.getQualifiedMethodName(method, (target != null ? target.getClass() : null));
|
||||
}
|
||||
});
|
||||
|
||||
@@ -26,8 +26,8 @@ import java.util.Collections;
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 7.0
|
||||
* @param includes applicable exceptions types to attempt a retry for
|
||||
* @param excludes non-applicable exceptions types to avoid a retry for
|
||||
* @param includes applicable exception types to attempt a retry for
|
||||
* @param excludes non-applicable exception types to avoid a retry for
|
||||
* @param predicate a predicate for filtering exceptions from applicable methods
|
||||
* @param maxAttempts the maximum number of retry attempts
|
||||
* @param delay the base delay after the initial invocation (in milliseconds)
|
||||
@@ -49,7 +49,7 @@ public record MethodRetrySpec(
|
||||
long maxDelay) {
|
||||
|
||||
public MethodRetrySpec(MethodRetryPredicate predicate, int maxAttempts, long delay) {
|
||||
this(predicate, maxAttempts, delay, 0,1.0, Integer.MAX_VALUE);
|
||||
this(predicate, maxAttempts, delay, 0, 1.0, Integer.MAX_VALUE);
|
||||
}
|
||||
|
||||
public MethodRetrySpec(MethodRetryPredicate predicate, int maxAttempts, long delay,
|
||||
|
||||
+2
-2
@@ -21,10 +21,10 @@ import org.springframework.aop.framework.autoproxy.AbstractBeanFactoryAwareAdvis
|
||||
import org.springframework.aop.support.ComposablePointcut;
|
||||
import org.springframework.aop.support.DefaultPointcutAdvisor;
|
||||
import org.springframework.aop.support.annotation.AnnotationMatchingPointcut;
|
||||
import org.springframework.beans.factory.config.BeanPostProcessor;
|
||||
|
||||
/**
|
||||
* A convenient {@link BeanPostProcessor} that applies {@link RetryAnnotationInterceptor}
|
||||
* A convenient {@link org.springframework.beans.factory.config.BeanPostProcessor
|
||||
* BeanPostProcessor} that applies {@link RetryAnnotationInterceptor}
|
||||
* to all bean methods annotated with {@link Retryable} annotations.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
|
||||
@@ -57,7 +57,7 @@ public @interface Retryable {
|
||||
Class<? extends Throwable>[] value() default {};
|
||||
|
||||
/**
|
||||
* Applicable exceptions types to attempt a retry for. This attribute
|
||||
* Applicable exception types to attempt a retry for. This attribute
|
||||
* allows for the convenient specification of assignable exception types.
|
||||
* <p>The default is empty, leading to a retry attempt for any exception.
|
||||
* @see #excludes()
|
||||
@@ -67,7 +67,7 @@ public @interface Retryable {
|
||||
Class<? extends Throwable>[] includes() default {};
|
||||
|
||||
/**
|
||||
* Non-applicable exceptions types to avoid a retry for. This attribute
|
||||
* Non-applicable exception types to avoid a retry for. This attribute
|
||||
* allows for the convenient specification of assignable exception types.
|
||||
* <p>The default is empty, leading to a retry attempt for any exception.
|
||||
* @see #includes()
|
||||
@@ -117,7 +117,7 @@ public @interface Retryable {
|
||||
* A multiplier for a delay for the next retry attempt, applied
|
||||
* to the previous delay (starting with {@link #delay()}) as well
|
||||
* as to the applicable {@link #jitterDelay()} for each attempt.
|
||||
* <p>The default is 1.0, effectively leading to a fixed delay.
|
||||
* <p>The default is 1.0, effectively resulting in a fixed delay.
|
||||
* @see #delay()
|
||||
* @see #jitterDelay()
|
||||
* @see #maxDelay()
|
||||
@@ -127,7 +127,7 @@ public @interface Retryable {
|
||||
/**
|
||||
* The maximum delay for any retry attempt (in milliseconds), limiting
|
||||
* how far {@link #jitterDelay()} and {@link #delayMultiplier()} can
|
||||
* increase {@link #delay()}.
|
||||
* increase the {@linkplain #delay() delay}.
|
||||
* <p>The default is unlimited.
|
||||
* @see #delay()
|
||||
* @see #jitterDelay()
|
||||
|
||||
@@ -61,25 +61,25 @@ import org.springframework.util.Assert;
|
||||
public class ExponentialBackOff implements BackOff {
|
||||
|
||||
/**
|
||||
* The default initial interval: 2000 ms.
|
||||
* The default initial interval: {@value} ms.
|
||||
*/
|
||||
public static final long DEFAULT_INITIAL_INTERVAL = 2000L;
|
||||
|
||||
/**
|
||||
* The default jitter range for each interval: 0 ms.
|
||||
* The default jitter range for each interval: {@value} ms.
|
||||
* @since 7.0
|
||||
*/
|
||||
public static final long DEFAULT_JITTER = 0;
|
||||
|
||||
/**
|
||||
* The default multiplier (increases the interval by 50%).
|
||||
* The default multiplier (increases the interval by 50%): {@value}.
|
||||
*/
|
||||
public static final double DEFAULT_MULTIPLIER = 1.5;
|
||||
|
||||
/**
|
||||
* The default maximum back-off time: 30000 ms.
|
||||
* The default maximum back-off time: {@value} ms.
|
||||
*/
|
||||
public static final long DEFAULT_MAX_INTERVAL = 30000L;
|
||||
public static final long DEFAULT_MAX_INTERVAL = 30_000L;
|
||||
|
||||
/**
|
||||
* The default maximum elapsed time: unlimited.
|
||||
|
||||
Reference in New Issue
Block a user