Class TransactionManager
java.lang.Object
net.neoforged.neoforge.transfer.transaction.TransactionManager
Manager for handling opening new
Transactions or querying status of a transaction chain in a given thread.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) intprivate static final ThreadLocal<TransactionManager> (package private) boolean(package private) final Queue<SnapshotJournal<?>> (package private) final List<Transaction> (package private) final Thread -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static TransactionManager(package private) TransactiongetOpenTransaction(int depth) Return the transaction with the specified depth.(package private) Transactionopen(@Nullable TransactionContext parent, Class<?> callerClass) (package private) @Nullable RuntimeExceptionprocessRootCommitQueue(@Nullable RuntimeException closeException) (package private) void(package private) voidvalidateCurrentTransaction(Transaction transaction)
-
Field Details
-
MANAGERS
-
thread
-
stack
-
currentDepth
int currentDepth -
rootCommitQueue
-
processingRootCommitQueue
boolean processingRootCommitQueue
-
-
Constructor Details
-
TransactionManager
private TransactionManager()
-
-
Method Details
-
getManagerForThread
- Returns:
- The manager for the current thread.
-
open
-
getOpenTransaction
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
-
processRootCommitQueue
-