Class RetryImpl.ContextImpl
java.lang.Object
io.github.resilience4j.retry.internal.RetryImpl.ContextImpl
- All Implemented Interfaces:
Retry.Context<T>
public final class RetryImpl.ContextImpl extends java.lang.Object implements Retry.Context<T>
-
Method Summary
Modifier and Type Method Description voidonComplete()Records a successful call or retryable call with the needed generated retry events.voidonError(java.lang.Exception exception)Handles a checked exceptionbooleanonResult(T result)voidonRuntimeError(java.lang.RuntimeException runtimeException)Handles a runtime exceptionvoidonSuccess()Deprecated.since 1.2.0
-
Method Details
-
onSuccess
@Deprecated public void onSuccess()Deprecated.since 1.2.0Description copied from interface:Retry.ContextRecords a successful call.- Specified by:
onSuccessin interfaceRetry.Context<T>
-
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
public void onError(java.lang.Exception exception) throws java.lang.ExceptionDescription copied from interface:Retry.ContextHandles a checked exception- Specified by:
onErrorin interfaceRetry.Context<T>- Parameters:
exception- the exception to handle- Throws:
java.lang.Exception- when retry count has exceeded
-
onRuntimeError
public void onRuntimeError(java.lang.RuntimeException runtimeException)Description copied from interface:Retry.ContextHandles a runtime exception- Specified by:
onRuntimeErrorin interfaceRetry.Context<T>- Parameters:
runtimeException- the exception to handle
-