T - transaction return typepublic static class RetryTransactionProvider.RetrySetup<T> extends Object
Instances are immutable.
RetryTransactionProvider.retry()| Constructor and Description |
|---|
RetrySetup(String transactionManagerName,
String description,
Supplier<T> transaction)
Constructor that uses the aspect default values for maximum retries, initial delay, and maximum delay.
|
RetrySetup(String transactionManagerName,
String description,
Supplier<T> transaction,
int maxRetries,
long initialDelay,
long maximumDelay)
Primary constructor.
|
RetrySetup(String transactionManagerName,
String description,
Supplier<T> transaction,
RetryTransaction annotation)
Constructor that uses the values from a
@RetryTransaction annotation, if not null,
for maximum retries, initial delay, and maximum delay, otherwise falling back to the aspect defaults. |
| Modifier and Type | Method and Description |
|---|---|
String |
getDescription()
Get a description of the transaction for logging purposes.
|
long |
getInitialDelay()
Get the initial delay between retry attempts in milliseconds.
|
long |
getMaximumDelay()
Get the maximum delay between retry attempts in milliseconds.
|
int |
getMaxRetries()
Get the maximum number of transaction retry attempts.
|
Supplier<T> |
getTransaction()
Get the transaction to perform and possibly retry.
|
String |
getTransactionManagerName()
Get name of the associated transaction manager, if any.
|
public RetrySetup(String transactionManagerName, String description, Supplier<T> transaction)
transactionManagerName - the name of the associated transaction manager, if any, otherwise nulldescription - description of transaction for logging purposestransaction - the transaction that should be invoked and retried as neededpublic RetrySetup(String transactionManagerName, String description, Supplier<T> transaction, RetryTransaction annotation)
@RetryTransaction annotation, if not null,
for maximum retries, initial delay, and maximum delay, otherwise falling back to the aspect defaults.transactionManagerName - the name of the associated transaction manager, if any, otherwise nulldescription - description of transaction for logging purposestransaction - the transaction that should be invoked and retried as neededannotation - @RetryTransaction annotation, or null to use aspect defaultspublic RetrySetup(String transactionManagerName, String description, Supplier<T> transaction, int maxRetries, long initialDelay, long maximumDelay)
transactionManagerName - the name of the associated transaction manager, if any, otherwise nulldescription - description of transaction for logging purposestransaction - the transaction that should be invoked and retried as neededmaxRetries - maximum number of transaction retry attempts, or -1 to use the aspect defaultinitialDelay - initial delay between retry attempts in milliseconds, or -1 to use the aspect defaultmaximumDelay - maximum delay between retry attempts in milliseconds, or -1 to use the aspect defaultpublic String getTransactionManagerName()
This value is used by the woven aspect to avoid redundant nested retries within an already-open transaction.
public String getDescription()
public Supplier<T> getTransaction()
public int getMaxRetries()
public long getInitialDelay()
public long getMaximumDelay()
Copyright © 2020. All rights reserved.