Class RetryImpl.ContextImpl
java.lang.Object
io.github.resilience4j.retry.internal.RetryImpl.ContextImpl
- All Implemented Interfaces:
Retry.Context<T>
-
Method Summary
Modifier and TypeMethodDescriptionvoidRecords a successful call or retryable call with the needed generated retry events.voidHandles a checked exceptionbooleanvoidonRuntimeError(RuntimeException runtimeException) Handles a runtime exception
-
Method Details
-
onComplete
public void onComplete()Description copied from interface:Retry.ContextRecords a successful call or retryable call with the needed generated retry events. When there is a successful retry before reaching the max retries limit, it will generate aRetryOnSuccessEvent. When the retry reaches the max retries limit, it will generate aRetryOnErrorEventwith last exception orMaxRetriesExceededif no other exceptions is thrown.- Specified by:
onCompletein interfaceRetry.Context<T>
-
onResult
- Specified by:
onResultin interfaceRetry.Context<T>- Parameters:
result- the returned result from the called logic- Returns:
- true if we need to retry again or false if no retry anymore
-
onError
Description copied from interface:Retry.ContextHandles a checked exception- Specified by:
onErrorin interfaceRetry.Context<T>- Parameters:
exception- the exception to handle- Throws:
Exception- when retry count has exceeded
-
onRuntimeError
Description copied from interface:Retry.ContextHandles a runtime exception- Specified by:
onRuntimeErrorin interfaceRetry.Context<T>- Parameters:
runtimeException- the exception to handle
-