@Inherited @Documented @Retention(value=RUNTIME) @Target(value={METHOD,TYPE}) @InterceptorBinding public @interface Retry
FaultToleranceDefinitionException
.
When a method returns and the retry policy is present, the following rules are applied:
abortOn()
parameter, the thrown object is rethrown.
retryOn()
parameter, the method call is retried.
Throwable
which is not an Error
or Exception
, non-portable behavior results.Modifier and Type | Optional Element and Description |
---|---|
Class<? extends Throwable>[] |
abortOn
The list of exception types that should not trigger a retry.
|
long |
delay
The delay between retries.
|
ChronoUnit |
delayUnit
The unit for
delay() . |
ChronoUnit |
durationUnit
The duration unit for
maxDuration() . |
long |
jitter
Set the jitter to randomly vary retry delays for.
|
ChronoUnit |
jitterDelayUnit
The delay unit for
jitter() . |
long |
maxDuration
The max duration.
|
int |
maxRetries
The max number of the retries.
|
Class<? extends Throwable>[] |
retryOn
The list of exception types that should trigger a retry.
|
public abstract int maxRetries
public abstract long delay
public abstract ChronoUnit delayUnit
delay()
. Defaults to ChronoUnit.MILLIS
if not set.public abstract long maxDuration
public abstract ChronoUnit durationUnit
maxDuration()
. Defaults to ChronoUnit.MILLIS
if not set.public abstract long jitter
Set the jitter to randomly vary retry delays for. The value must be greater than or equals to 0. 0 means not set.
The effective delay will be [delay - jitter, delay + jitter] and always greater than or equal to 0. Negative effective delays will be 0.public abstract ChronoUnit jitterDelayUnit
jitter()
. Defaults to ChronoUnit.MILLIS
if not set.public abstract Class<? extends Throwable>[] retryOn
Note that if a method throws a Throwable
which is not an Error
or Exception
, non-portable behavior results.
public abstract Class<? extends Throwable>[] abortOn
This list takes priority over the types listed in retryOn()
.
Note that if a method throws a Throwable
which is not an Error
or Exception
, non-portable behavior results.
Copyright © 2020 Eclipse Foundation. All rights reserved.