- All Known Implementing Classes:
BaseInfGraph.InfTransactionHandler
,SimpleTransactionHandler
,TransactionHandlerBase
public interface TransactionHandler
Preliminary interface for graphs supporting transactions.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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
Execute the supplieraction
within a transaction.<T> T
calculateAlways
(Supplier<T> action) Calculate inside a transaction if transactions supported - calculate anyway if transactions not supported.void
commit()
If transactions are supported and there is a transaction in progress, commit it.void
Execute the runnableaction
within a transaction.void
executeAlways
(Runnable action) Execute inside a transaction if transactions supported - execute anyway if transactions not supported.boolean
Does this handler support transactions at all?
-
Method Details
-
transactionsSupported
boolean transactionsSupported()Does this handler support transactions at all?- Returns:
- true iff begin/abort/commit are implemented and make sense.
-
begin
void begin()If transactions are supported, begin a new transaction. If transactions are not supported, or they are but this transaction is nested and nested transactions are not supported, throw an UnsupportedOperationException. -
abort
void abort()If transactions are supported and there is a transaction in progress, abort it. If transactions are not supported, or there is no transaction in progress, throw an UnsupportedOperationException. -
commit
void commit()If transactions are supported and there is a transaction in progress, commit it. If transactions are not supported, , or there is no transaction in progress, throw an UnsupportedOperationException. -
execute
Execute the runnableaction
within a transaction. If it completes normally, commit the transaction, otherwise abort the transaction. -
executeAlways
Execute inside a transaction if transactions supported - execute anyway if transactions not supported. -
calculate
Execute the supplieraction
within a transaction. If it completes normally, commit the transaction and return the result, otherwise abort the transaction. -
calculateAlways
Calculate inside a transaction if transactions supported - calculate anyway if transactions not supported.
-