Class StatisticsListener

java.lang.Object
org.springframework.retry.stats.StatisticsListener
All Implemented Interfaces:
RetryListener

public class StatisticsListener extends Object implements RetryListener
Author:
Dave Syer, Henning Pƶttker
  • Constructor Details

  • Method Details

    • close

      public <T, E extends Throwable> void close(RetryContext context, RetryCallback<T,E> callback, Throwable throwable)
      Description copied from interface: RetryListener
      Called 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:
      close in interface RetryListener
      Type Parameters:
      T - the return value
      E - the exception type
      Parameters:
      context - the current RetryContext.
      callback - the current RetryCallback.
      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: RetryListener
      Called after every unsuccessful attempt at a retry.
      Specified by:
      onError in interface RetryListener
      Type Parameters:
      T - the return value
      E - the exception to throw
      Parameters:
      context - the current RetryContext.
      callback - the current RetryCallback.
      throwable - the last exception that was thrown by the callback.