Class SimpleRetry<E extends Exception>

java.lang.Object
ubic.gemma.core.util.SimpleRetry<E>

public class SimpleRetry<E extends Exception> extends Object
A simple retry implementation with exponential backoff.

This is mainly meant for simple use cases, use RetryTemplate otherwise.

Author:
poirigui
  • Constructor Details

    • SimpleRetry

      public SimpleRetry(SimpleRetryPolicy retryPolicy, Class<E> exceptionClass, String logCategory)
      Create a new simply retry strategy.
      Parameters:
      exceptionClass - the type of exception on which retry happens
      logCategory - log category to use for retry-related messages
  • Method Details

    • execute

      public <T> T execute(SimpleRetryCallable<T,E> callable, Object what) throws E
      Execute the given callable with a retry strategy.
      Parameters:
      what - an object describing what is being retried, it's toString() will be used for logging
      Throws:
      E - the first exception to occur, all other will be included as suppressed via Throwable.addSuppressed(Throwable).