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 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 Details

    • TransactionHandlerBase

      public TransactionHandlerBase()
  • Method Details

    • execute

      public void execute(Runnable action)
      Execute the runnable action within a transaction. If it completes normally, commit the transaction, otherwise abort the transaction.
      Specified by:
      execute in interface TransactionHandler
    • executeAlways

      public void executeAlways(Runnable action)
      Execute inside a transaction if transactions supported - execute anyway if transactions not supported.
      Specified by:
      executeAlways in interface TransactionHandler
    • calculate

      public <T> T calculate(Supplier<T> action)
      Execute the supplier action within a transaction. If it completes normally, commit the transaction and return the result, otherwise abort the transaction.
      Specified by:
      calculate in interface TransactionHandler
    • calculateAlways

      public <T> T calculateAlways(Supplier<T> action)
      Calculate inside a transaction if transactions supported - calculate anyway if transactions not supported.
      Specified by:
      calculateAlways in interface TransactionHandler