Record Class MethodRetrySpec
java.lang.Object
java.lang.Record
org.springframework.aop.retry.MethodRetrySpec
- Record Components:
includes
- applicable exception types to attempt a retry forexcludes
- non-applicable exception types to avoid a retry forpredicate
- a predicate for filtering exceptions from applicable methodsmaxAttempts
- the maximum number of retry attemptsdelay
- the base delay after the initial invocation (in milliseconds)jitterDelay
- a jitter delay for the next retry attempt (in milliseconds)delayMultiplier
- a multiplier for a delay for the next retry attemptmaxDelay
- the maximum delay for any retry attempt (in milliseconds)
public record MethodRetrySpec(Collection<Class<? extends Throwable>> includes, Collection<Class<? extends Throwable>> excludes, MethodRetryPredicate predicate, int maxAttempts, long delay, long jitterDelay, double delayMultiplier, long maxDelay)
extends Record
A specification for retry attempts on a given method, combining common
retry characteristics. This roughly matches the annotation attributes
on
Retryable
.- Since:
- 7.0
- Author:
- Juergen Hoeller
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMethodRetrySpec
(Collection<Class<? extends Throwable>> includes, Collection<Class<? extends Throwable>> excludes, MethodRetryPredicate predicate, int maxAttempts, long delay, long jitterDelay, double delayMultiplier, long maxDelay) Creates an instance of aMethodRetrySpec
record class.MethodRetrySpec
(MethodRetryPredicate predicate, int maxAttempts, long delay) MethodRetrySpec
(MethodRetryPredicate predicate, int maxAttempts, long delay, long jitterDelay, double delayMultiplier, long maxDelay) -
Method Summary
Modifier and TypeMethodDescriptionlong
delay()
Returns the value of thedelay
record component.double
Returns the value of thedelayMultiplier
record component.final boolean
Indicates whether some other object is "equal to" this one.Collection
<Class<? extends Throwable>> excludes()
Returns the value of theexcludes
record component.final int
hashCode()
Returns a hash code value for this object.Collection
<Class<? extends Throwable>> includes()
Returns the value of theincludes
record component.long
Returns the value of thejitterDelay
record component.int
Returns the value of themaxAttempts
record component.long
maxDelay()
Returns the value of themaxDelay
record component.Returns the value of thepredicate
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
MethodRetrySpec
-
MethodRetrySpec
public MethodRetrySpec(MethodRetryPredicate predicate, int maxAttempts, long delay, long jitterDelay, double delayMultiplier, long maxDelay) -
MethodRetrySpec
public MethodRetrySpec(Collection<Class<? extends Throwable>> includes, Collection<Class<? extends Throwable>> excludes, MethodRetryPredicate predicate, int maxAttempts, long delay, long jitterDelay, double delayMultiplier, long maxDelay) Creates an instance of aMethodRetrySpec
record class.- Parameters:
includes
- the value for theincludes
record componentexcludes
- the value for theexcludes
record componentpredicate
- the value for thepredicate
record componentmaxAttempts
- the value for themaxAttempts
record componentdelay
- the value for thedelay
record componentjitterDelay
- the value for thejitterDelay
record componentdelayMultiplier
- the value for thedelayMultiplier
record componentmaxDelay
- the value for themaxDelay
record component
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with thecompare
method from their corresponding wrapper classes. -
includes
-
excludes
-
predicate
-
maxAttempts
public int maxAttempts()Returns the value of themaxAttempts
record component.- Returns:
- the value of the
maxAttempts
record component
-
delay
-
jitterDelay
public long jitterDelay()Returns the value of thejitterDelay
record component.- Returns:
- the value of the
jitterDelay
record component
-
delayMultiplier
public double delayMultiplier()Returns the value of thedelayMultiplier
record component.- Returns:
- the value of the
delayMultiplier
record component
-
maxDelay
-