Package org.springframework.retry.stats
Class StatisticsListener
java.lang.Object
org.springframework.retry.stats.StatisticsListener
- All Implemented Interfaces:
RetryListener
- Author:
- Dave Syer, Henning Pƶttker
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T,E extends Throwable>
voidclose(RetryContext context, RetryCallback<T, E> callback, Throwable throwable) Called after the final attempt (successful or not).<T,E extends Throwable>
voidonError(RetryContext context, RetryCallback<T, E> callback, Throwable throwable) Called after every unsuccessful attempt at a retry.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.retry.RetryListener
onSuccess, open
-
Constructor Details
-
StatisticsListener
-
-
Method Details
-
close
public <T,E extends Throwable> void close(RetryContext context, RetryCallback<T, E> callback, Throwable throwable) Description copied from interface:RetryListenerCalled after the final attempt (successful or not). Allow the listener to clean up any resource it is holding before control returns to the retry caller.- Specified by:
closein interfaceRetryListener- Type Parameters:
T- the return valueE- the exception type- Parameters:
context- the currentRetryContext.callback- the currentRetryCallback.throwable- the last exception that was thrown by the callback.
-
onError
public <T,E extends Throwable> void onError(RetryContext context, RetryCallback<T, E> callback, Throwable throwable) Description copied from interface:RetryListenerCalled after every unsuccessful attempt at a retry.- Specified by:
onErrorin interfaceRetryListener- Type Parameters:
T- the return valueE- the exception to throw- Parameters:
context- the currentRetryContext.callback- the currentRetryCallback.throwable- the last exception that was thrown by the callback.
-