Package io.smallrye.faulttolerance.api
Annotation Type BeforeRetry
@Inherited
@Documented
@Retention(RUNTIME)
@Target({METHOD,TYPE})
@Experimental("first attempt at providing before retry actions")
public @interface BeforeRetry
Defines a handler or method that should be called before any retry, but not before the initial attempt.
May only be present on elements that are also annotated
@Retry.
The before retry action must be fast and non-blocking (i.e., it must not do any IO or long-running computations) and must not throw an exception.
Only one of value() and methodName() can be specified. If both of them are,
deployment problem occurs.
- See Also:
-
Nested Class Summary
Nested Classes -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionSpecifies the name of the method to call before each retry.Class<? extends BeforeRetryHandler> Specify the before retry handler class to be used.
-
Element Details
-
value
Class<? extends BeforeRetryHandler> valueSpecify the before retry handler class to be used. A new instance of the handler class is created for each retry.- Returns:
- the before retry handler class
- Default:
io.smallrye.faulttolerance.api.BeforeRetry.DEFAULT.class
-
methodName
String methodNameSpecifies the name of the method to call before each retry. This method belongs to the same class as the method that is being retried. The method must have no parameters and returnvoid.- Returns:
- the method to call before each retry
- Default:
""
-