- All Known Implementing Classes:
BaseInfGraph.InfTransactionHandler,SimpleTransactionHandler,TransactionHandlerBase
public interface TransactionHandler
Preliminary interface for graphs supporting transactions.
-
Method Summary
Modifier and TypeMethodDescriptionvoidabort()If transactions are supported and there is a transaction in progress, abort it.voidbegin()If transactions are supported, begin a new transaction.<T> TExecute the supplieractionwithin a transaction.<T> TcalculateAlways(Supplier<T> action) Calculate inside a transaction if transactions supported - calculate anyway if transactions not supported.voidcommit()If transactions are supported and there is a transaction in progress, commit it.voidExecute the runnableactionwithin a transaction.voidexecuteAlways(Runnable action) Execute inside a transaction if transactions supported - execute anyway if transactions not supported.booleanDoes 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 runnableactionwithin 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 supplieractionwithin 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.
-