Package io.smallrye.faulttolerance.api
Interface BeforeRetryHandler
-
- All Known Implementing Classes:
BeforeRetry.DEFAULT
public interface BeforeRetryHandlerFor each retry attempt, a new instance of the handler is created by the CDI container. The instance is created before thehandle(ExecutionContext)method is called, and after it finishes, the instance is destroyed. The implementation class can declare injection points, lifecycle callbacks and so on.Usage
@ApplicationScoped public class MyService { @Inject OtherService otherService; @Retry @BeforeRetry(MyBeforeRetry.class) String doSomething() { return otherService.hello(); } } public class MyBeforeRetry implements BeforeRetryHandler { @Inject OtherService otherService; void handle(ExecutionContext context) { otherService.reset(); } }
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidhandle(org.eclipse.microprofile.faulttolerance.ExecutionContext context)Do what is necessary before the next retry attempt.
-