public class Transactions extends Object
| Constructor and Description |
|---|
Transactions() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
atomically(FunctionalTransaction<T> transaction)
Tries to evaluate a
FunctionalTransaction, retrying each one several times in case of failures. |
static void |
atomically(VoidTransaction... voidTransactions)
Tries to perform one or more
VoidTransactions, retrying each one several times in case of failures. |
static <T> FunctionalTransaction<T> |
evaluate(SupplierWithException<T> function)
Builds a
FunctionalTransaction that can have a rollback and/or a commit. |
static VoidTransaction |
perform(RunnableWithException r)
Builds an
VoidTransaction that can have a rollback and/or a commit. |
public static VoidTransaction perform(RunnableWithException r)
VoidTransaction that can have a rollback and/or a commit.r - the operation to performVoidTransaction object for chaining modifierspublic static void atomically(VoidTransaction... voidTransactions)
VoidTransactions, retrying each one several times in case of failures.
VoidTransactions can have defined rollbacks and commits, number of retries etc.voidTransactions - the transactions to performpublic static <T> FunctionalTransaction<T> evaluate(SupplierWithException<T> function)
FunctionalTransaction that can have a rollback and/or a commit.T - the type of the value to returnfunction - the function to evaluatepublic static <T> T atomically(FunctionalTransaction<T> transaction)
FunctionalTransaction, retrying each one several times in case of failures.
FunctionalTransactions can have defined rollbacks and commits, number of retries etc.T - the type of the value to returntransaction - the transactiontransaction to evaluateCopyright © 2019. All rights reserved.