Package org.wildfly.transaction.client
Class RemoteTransactionContext
java.lang.Object
org.wildfly.transaction.client.RemoteTransactionContext
- All Implemented Interfaces:
org.wildfly.common.context.Contextual<RemoteTransactionContext>
public final class RemoteTransactionContext
extends Object
implements org.wildfly.common.context.Contextual<RemoteTransactionContext>
The remote transaction context.
- Author:
- David M. Lloyd
-
Constructor Summary
ConstructorsConstructorDescriptionRemoteTransactionContext(ClassLoader classLoader) Construct a new instance.RemoteTransactionContext(List<RemoteTransactionProvider> providers) Construct a new instance. -
Method Summary
Modifier and TypeMethodDescriptionstatic org.wildfly.common.context.ContextManager<RemoteTransactionContext>Get the remote transaction context manager.static RemoteTransactionContextGet the active remote transaction context instance.org.wildfly.common.context.ContextManager<RemoteTransactionContext>Get aUserTransactionthat controls a remote transactions state at the givenlocation.jakarta.transaction.UserTransactionDeprecated.outflowTransaction(URI location, LocalTransaction transaction) Outflow the given local transaction to the given location.voidregisterCreationListener(CreationListener creationListener) Register a transaction creation listener.voidremoveCreationListener(CreationListener creationListener) Remove a transaction creation listener.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.wildfly.common.context.Contextual
run, runAction, runBiConsumer, runBiFunction, runBiPredicate, runCallable, runConsumer, runExBiConsumer, runExBiFunction, runExBiPredicate, runExceptionAction, runExConsumer, runExFunction, runExIntFunction, runExLongFunction, runExPredicate, runFunction, runIntFunction, runLongFunction, runPredicate
-
Constructor Details
-
RemoteTransactionContext
Construct a new instance. The given class loader is scanned for transaction providers.- Parameters:
classLoader- the class loader to scan for transaction providers (nullindicates the application or bootstrap class loader)
-
RemoteTransactionContext
Construct a new instance. The given non-empty list of providers is used.- Parameters:
providers- the list of providers to use (must not benullor empty)
-
-
Method Details
-
registerCreationListener
Register a transaction creation listener.- Parameters:
creationListener- the creation listener (must not benull)
-
removeCreationListener
Remove a transaction creation listener.- Parameters:
creationListener- the creation listener (must not benull)
-
getContextManager
public static org.wildfly.common.context.ContextManager<RemoteTransactionContext> getContextManager()Get the remote transaction context manager.- Returns:
- the context manager
-
getInstanceContextManager
public org.wildfly.common.context.ContextManager<RemoteTransactionContext> getInstanceContextManager()- Specified by:
getInstanceContextManagerin interfaceorg.wildfly.common.context.Contextual<RemoteTransactionContext>
-
getInstance
Get the active remote transaction context instance.- Returns:
- the remote transaction context instance (not
null)
-
getUserTransaction
Get aUserTransactionthat controls a remote transactions state at the givenlocation. The transaction context may cache these instances by location.- Returns:
- the
UserTransaction(notnull)
-
getUserTransaction$$bridge_compat
public jakarta.transaction.UserTransaction getUserTransaction$$bridge_compat()Deprecated.Please usegetUserTransaction()instead.Compatibility bridge method.- Returns:
- the
UserTransaction(notnull)
-
outflowTransaction
public XAOutflowHandle outflowTransaction(URI location, LocalTransaction transaction) throws jakarta.transaction.SystemException, IllegalStateException, UnsupportedOperationException, jakarta.transaction.RollbackException Outflow the given local transaction to the given location. The returned handle must be used to confirm or forget the enlistment attempt either immediately or at some point in the future; failure to do so may cause the transaction to be rolled back with an error.- Parameters:
location- the location to outflow to (must not benull)transaction- the transaction (must not benull)- Returns:
- the enlistment handle (not
null) - Throws:
jakarta.transaction.SystemException- if the transaction manager fails for some reasonjakarta.transaction.RollbackException- if the transaction has been rolled back in the meantimeIllegalStateException- if no transaction is activeUnsupportedOperationException- if the provider for the location does not support outflow
-
getUserTransaction()instead.