T - The return value of the work.public class TransactionRetryHelper<T> extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
TransactionRetryHelper.Builder<T>
Constructs a TransactionRetryStrategy.
|
| Modifier and Type | Method and Description |
|---|---|
T |
exponentialBackoff()
Executes the work with a default number of retries with a exponentially increasing number of milliseconds
between each retry.
|
T |
exponentialBackoff(int retries)
Executes the work with a specified number of retries with a exponentially increasing number of milliseconds
between each retry.
|
T |
exponentialBackoff(int retries,
long initialDelay)
Executes the work with a specified number of retries with a exponentially increasing number of milliseconds
between each retry.
|
T |
exponentialBackoff(int retries,
long initialDelay,
Set<Class> exceptionsToRetryOn)
Executes the work with a specified number of retries with a exponentially increasing number of milliseconds
between each retry.
|
T |
fireAndForget()
Executes the work committing if possible and rolling back on failure.
|
T |
oneAndDone()
Executes the work committing if possible and rolling back on failure.
|
T |
retry()
Executes the work with a default number of retries with a default number of milliseconds delay between
each try.
|
T |
retry(int retries)
Executes the work with a specified number of retries with a default number of milliseconds delay between
each try.
|
T |
retry(int retries,
long delayBetweenRetries)
Executes the work with a specified number of retries with a specified number of milliseconds delay between
each try.
|
T |
retry(int retries,
long delayBetweenRetries,
Set<Class> exceptionsToRetryOn)
Executes the work with a specified number of retries with a specified number of milliseconds delay between
each try.
|
T |
use(TransactionRetryStrategy<T> strategy)
Executes the work with a specified TransactionRetryStrategy.
|
public T fireAndForget()
public T oneAndDone()
public T retry()
public T retry(int retries)
public T retry(int retries, long delayBetweenRetries)
public T retry(int retries, long delayBetweenRetries, Set<Class> exceptionsToRetryOn)
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 exponentialBackoff()
public T exponentialBackoff(int retries)
public T exponentialBackoff(int retries, long initialDelay)
public T exponentialBackoff(int retries, long initialDelay, Set<Class> exceptionsToRetryOn)
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 use(TransactionRetryStrategy<T> strategy)
Copyright © 2010-2014. All Rights Reserved.