public interface TransactionHandler
Modifier and Type | Method and Description |
---|---|
void |
abort()
If transactions are supported and there is a transaction in progress, abort
it.
|
void |
begin()
If transactions are supported, begin a new transaction.
|
<T> T |
calculate(Supplier<T> action)
Execute the supplier
action within a transaction. |
void |
commit()
If transactions are supported and there is a transaction in progress, commit
it.
|
void |
execute(Runnable action)
Execute the runnable
action within a transaction. |
Object |
executeInTransaction(Command c)
Deprecated.
|
boolean |
transactionsSupported()
Does this handler support transactions at all?
|
boolean transactionsSupported()
void begin()
void abort()
void commit()
Object executeInTransaction(Command c)
execute(Runnable)
or calculate(Supplier)
void execute(Runnable action)
action
within a transaction. If it completes normally,
commit the transaction, otherwise abort the transaction.<T> T calculate(Supplier<T> action)
action
within a transaction. If it completes normally,
commit the transaction and return the result, otherwise abort the transaction.Licenced under the Apache License, Version 2.0