Package org.apache.jena.graph.impl
Class TransactionHandlerBase
- java.lang.Object
-
- org.apache.jena.graph.impl.TransactionHandlerBase
-
- All Implemented Interfaces:
TransactionHandler
- Direct Known Subclasses:
BaseInfGraph.InfTransactionHandler
,SimpleTransactionHandler
public abstract class TransactionHandlerBase extends java.lang.Object implements TransactionHandler
A base for transaction handlers; provide implementations of execute* operations using the fundamental begin-commit-abort. (This class predates java8 default methods.)
-
-
Constructor Summary
Constructors Constructor Description TransactionHandlerBase()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
calculate(java.util.function.Supplier<T> action)
Execute the supplieraction
within a transaction.void
execute(java.lang.Runnable action)
Execute the runnableaction
within a transaction.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.jena.graph.TransactionHandler
abort, begin, commit, transactionsSupported
-
-
-
-
Method Detail
-
execute
public void execute(java.lang.Runnable action)
Execute the runnableaction
within a transaction. If it completes normally, commit the transaction, otherwise abort the transaction.- Specified by:
execute
in interfaceTransactionHandler
-
calculate
public <T> T calculate(java.util.function.Supplier<T> action)
Execute the supplieraction
within a transaction. If it completes normally, commit the transaction and return the result, otherwise abort the transaction.- Specified by:
calculate
in interfaceTransactionHandler
-
-