/** * Executes the work with a specified number of retries with a default number of milliseconds delay between * each try. */ public T retry(final int retries) { return use(new TransactionRetryStrategy.DelayedRetry<T>(retries, TransactionRetryStrategy.DelayedRetry.DEFAULT_DELAY_MS)); }
/** * Executes the work with a specified number of retries with a specified number of milliseconds delay between * each try. */ public T retry(final int retries, final long delayBetweenRetries) { return use(new TransactionRetryStrategy.DelayedRetry<T>(retries, delayBetweenRetries)); }
/** * Executes the work with a specified number of retries with a specified number of milliseconds delay between * each try. * * @param exceptionsToRetryOn For a retry to happen, it must be in this set of accepted exceptions. If an * exception raises that is not in the set, then an error is immediately raised * with no retry. */ public T retry(final int retries, final long delayBetweenRetries, final Set<Class> exceptionsToRetryOn ) { return use(new TransactionRetryStrategy.DelayedRetry<T>(retries, delayBetweenRetries, exceptionsToRetryOn)); }
/** * Executes the work with a default number of retries with a default number of milliseconds delay between * each try. */ public T retry() { return use(new TransactionRetryStrategy.DelayedRetry<T>()); }