Package ubic.gemma.core.util
Class SimpleRetry<E extends Exception>
- java.lang.Object
-
- ubic.gemma.core.util.SimpleRetry<E>
-
-
Constructor Summary
Constructors Constructor Description SimpleRetry(SimpleRetryPolicy retryPolicy, Class<E> exceptionClass, String logCategory)
Create a new simply retry strategy.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
execute(SimpleRetryCallable<T,E> callable, Object what)
Execute the given callable with a retry strategy.
-
-
-
Constructor Detail
-
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 happenslogCategory
- log category to use for retry-related messages
-
-
Method Detail
-
execute
public <T> T execute(SimpleRetryCallable<T,E> callable, Object what) throws E extends Exception
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 viaThrowable.addSuppressed(Throwable)
.E extends Exception
-
-