| Modifier and Type | Method and Description |
|---|---|
<R> FunctionalTransaction<Pair<T,R>> |
FunctionalTransaction.and(FunctionWithException<T,R> f)
Creates another transaction and chains it to this one preserving the intermediate result.
|
static <T> FunctionalTransaction<T> |
Transactions.evaluate(SupplierWithException<T> function)
Builds a
FunctionalTransaction that can have a rollback and/or a commit. |
FunctionalTransaction<T> |
FunctionalTransaction.retry(int times)
Specify the number of retires for the evaluation of this function.
|
<R> FunctionalTransaction<R> |
FunctionalTransaction.then(FunctionWithException<T,R> function)
Creates another transaction and chains it to this one.
|
FunctionalTransaction<T> |
FunctionalTransaction.withCommit(java.util.function.Consumer<T> commit)
Specify the commit for this function.
|
FunctionalTransaction<T> |
FunctionalTransaction.withReset(java.util.function.Consumer<T> rollback)
Alias for
withRollback(Consumer) |
FunctionalTransaction<T> |
FunctionalTransaction.withRollback(java.util.function.Consumer<T> rollback)
Specify the rollback for this function.
|
FunctionalTransaction<T> |
FunctionalTransaction.withRollback(Runnable rollback)
Specify the rollback for this function.
|
FunctionalTransaction<T> |
FunctionalTransaction.withVerification(java.util.function.Function<T,Boolean> verification)
Specify the verification for this function.
|
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
Transactions.atomically(FunctionalTransaction<T> transaction)
Tries to evaluate a
FunctionalTransaction, retrying each one several times in case of failures. |
static <T> T |
LongTransactions.transactionally(FunctionalTransaction<T> operation)
Adds a transactional operation the the transaction bound to the current thread.
|
| Constructor and Description |
|---|
FunctionalTransaction(FunctionWithException<I,T> function,
FunctionalTransaction<I> previous)
Constructs a lightweight transaction chained to a previous one.
|
Copyright © 2019. All rights reserved.