Class TransactionManager

java.lang.Object
net.neoforged.neoforge.transfer.transaction.TransactionManager

final class TransactionManager extends Object
Manager for handling opening new Transactions or querying status of a transaction chain in a given thread.
See Also:
  • Field Details

  • Constructor Details

    • TransactionManager

      private TransactionManager()
  • Method Details

    • getManagerForThread

      static TransactionManager getManagerForThread()
      Returns:
      The manager for the current thread.
    • open

      Transaction open(@Nullable TransactionContext parent, Class<?> callerClass)
    • getOpenTransaction

      Transaction getOpenTransaction(int depth)
      Return the transaction with the specified depth.
      Parameters:
      depth - Queried depth of the transaction desired.
      Throws:
      IndexOutOfBoundsException - If there is no open transaction with the requested depth.
      IllegalStateException - If this function is not called on the thread this transaction was opened in.
    • validateCurrentThread

      void validateCurrentThread()
    • validateCurrentTransaction

      void validateCurrentTransaction(Transaction transaction)
    • processRootCommitQueue

      @Nullable RuntimeException processRootCommitQueue(@Nullable RuntimeException closeException)