Package org.wildfly.transaction.client
Class LocalTransaction
java.lang.Object
org.wildfly.transaction.client.AbstractTransaction
org.wildfly.transaction.client.LocalTransaction
- All Implemented Interfaces:
jakarta.transaction.Transaction
A transaction from a local transaction provider.
- Author:
- David M. Lloyd
-
Method Summary
Modifier and TypeMethodDescriptionvoidcommit()booleandelistResource(XAResource xaRes, int flag) booleanenlistResource(XAResource xaRes) booleanGet the name of the node which initiated the transaction.<T> TgetProviderInterface(Class<T> providerInterfaceType) Get a provider-specific interface from this transaction.getResource(Object key) intintGet the transaction timeout that was in force when the transaction began.getXid()Get the XID of the local transaction.inthashCode()booleanDetermine if this transaction was imported.voidputResource(Object key, Object value) putResourceIfAbsent(Object key, Object value) voidregisterSynchronization(jakarta.transaction.Synchronization sync) voidrollback()voidtoString()Methods inherited from class org.wildfly.transaction.client.AbstractTransaction
getEstimatedRemainingTime, performAction, performConsumer, performConsumer, performConsumer, performFunction, performFunction, performSupplier, performToIntFunction, performToIntFunction, registerAssociationListener
-
Method Details
-
commit
public void commit() throws jakarta.transaction.RollbackException, jakarta.transaction.HeuristicMixedException, jakarta.transaction.HeuristicRollbackException, SecurityException, jakarta.transaction.SystemException- Specified by:
commitin interfacejakarta.transaction.Transaction- Specified by:
commitin classAbstractTransaction- Throws:
jakarta.transaction.RollbackExceptionjakarta.transaction.HeuristicMixedExceptionjakarta.transaction.HeuristicRollbackExceptionSecurityExceptionjakarta.transaction.SystemException
-
rollback
- Specified by:
rollbackin interfacejakarta.transaction.Transaction- Specified by:
rollbackin classAbstractTransaction- Throws:
IllegalStateExceptionjakarta.transaction.SystemException
-
setRollbackOnly
- Specified by:
setRollbackOnlyin interfacejakarta.transaction.Transaction- Overrides:
setRollbackOnlyin classAbstractTransaction- Throws:
IllegalStateExceptionjakarta.transaction.SystemException
-
getStatus
public int getStatus() throws jakarta.transaction.SystemException- Throws:
jakarta.transaction.SystemException
-
getTransactionTimeout
public int getTransactionTimeout()Description copied from class:AbstractTransactionGet the transaction timeout that was in force when the transaction began.- Specified by:
getTransactionTimeoutin classAbstractTransaction- Returns:
- the transaction timeout
-
enlistResource
public boolean enlistResource(XAResource xaRes) throws jakarta.transaction.RollbackException, IllegalStateException, jakarta.transaction.SystemException - Throws:
jakarta.transaction.RollbackExceptionIllegalStateExceptionjakarta.transaction.SystemException
-
delistResource
public boolean delistResource(XAResource xaRes, int flag) throws IllegalStateException, jakarta.transaction.SystemException - Throws:
IllegalStateExceptionjakarta.transaction.SystemException
-
registerSynchronization
public void registerSynchronization(jakarta.transaction.Synchronization sync) throws jakarta.transaction.RollbackException, IllegalStateException, jakarta.transaction.SystemException - Throws:
jakarta.transaction.RollbackExceptionIllegalStateExceptionjakarta.transaction.SystemException
-
getParentName
Get the name of the node which initiated the transaction.- Returns:
- the name of the node which initiated the transaction, or
nullif it could not be determined
-
getXid
Get the XID of the local transaction.- Returns:
- the transaction XID (not
null)
-
getResource
- Specified by:
getResourcein classAbstractTransaction- Throws:
NullPointerException
-
putResource
- Specified by:
putResourcein classAbstractTransaction- Throws:
NullPointerException
-
putResourceIfAbsent
- Specified by:
putResourceIfAbsentin classAbstractTransaction- Throws:
IllegalArgumentException
-
isImported
public boolean isImported()Determine if this transaction was imported.- Returns:
trueif the transaction was imported,falseif it was initiated locally
-
getProviderInterface
Description copied from class:AbstractTransactionGet a provider-specific interface from this transaction.- Overrides:
getProviderInterfacein classAbstractTransaction- Type Parameters:
T- the provider interface type- Parameters:
providerInterfaceType- the provider interface type class (must not benull)- Returns:
- the provider interface, or
nullif the given type isn't supported by this transaction's provider
-
hashCode
public int hashCode() -
equals
-
toString
-