Class LocalTransaction

java.lang.Object
org.wildfly.transaction.client.AbstractTransaction
org.wildfly.transaction.client.LocalTransaction
All Implemented Interfaces:
jakarta.transaction.Transaction

public final class LocalTransaction extends AbstractTransaction
A transaction from a local transaction provider.
Author:
David M. Lloyd
  • Method Details

    • commit

      public void commit() throws jakarta.transaction.RollbackException, jakarta.transaction.HeuristicMixedException, jakarta.transaction.HeuristicRollbackException, SecurityException, jakarta.transaction.SystemException
      Specified by:
      commit in interface jakarta.transaction.Transaction
      Specified by:
      commit in class AbstractTransaction
      Throws:
      jakarta.transaction.RollbackException
      jakarta.transaction.HeuristicMixedException
      jakarta.transaction.HeuristicRollbackException
      SecurityException
      jakarta.transaction.SystemException
    • rollback

      public void rollback() throws IllegalStateException, jakarta.transaction.SystemException
      Specified by:
      rollback in interface jakarta.transaction.Transaction
      Specified by:
      rollback in class AbstractTransaction
      Throws:
      IllegalStateException
      jakarta.transaction.SystemException
    • setRollbackOnly

      public void setRollbackOnly() throws IllegalStateException, jakarta.transaction.SystemException
      Specified by:
      setRollbackOnly in interface jakarta.transaction.Transaction
      Overrides:
      setRollbackOnly in class AbstractTransaction
      Throws:
      IllegalStateException
      jakarta.transaction.SystemException
    • getStatus

      public int getStatus() throws jakarta.transaction.SystemException
      Throws:
      jakarta.transaction.SystemException
    • getTransactionTimeout

      public int getTransactionTimeout()
      Description copied from class: AbstractTransaction
      Get the transaction timeout that was in force when the transaction began.
      Specified by:
      getTransactionTimeout in class AbstractTransaction
      Returns:
      the transaction timeout
    • enlistResource

      public boolean enlistResource(XAResource xaRes) throws jakarta.transaction.RollbackException, IllegalStateException, jakarta.transaction.SystemException
      Throws:
      jakarta.transaction.RollbackException
      IllegalStateException
      jakarta.transaction.SystemException
    • delistResource

      public boolean delistResource(XAResource xaRes, int flag) throws IllegalStateException, jakarta.transaction.SystemException
      Throws:
      IllegalStateException
      jakarta.transaction.SystemException
    • registerSynchronization

      public void registerSynchronization(jakarta.transaction.Synchronization sync) throws jakarta.transaction.RollbackException, IllegalStateException, jakarta.transaction.SystemException
      Throws:
      jakarta.transaction.RollbackException
      IllegalStateException
      jakarta.transaction.SystemException
    • getParentName

      public String getParentName()
      Get the name of the node which initiated the transaction.
      Returns:
      the name of the node which initiated the transaction, or null if it could not be determined
    • getXid

      public Xid getXid()
      Get the XID of the local transaction.
      Returns:
      the transaction XID (not null)
    • getResource

      public Object getResource(Object key) throws NullPointerException
      Specified by:
      getResource in class AbstractTransaction
      Throws:
      NullPointerException
    • putResource

      public void putResource(Object key, Object value) throws NullPointerException
      Specified by:
      putResource in class AbstractTransaction
      Throws:
      NullPointerException
    • putResourceIfAbsent

      public Object putResourceIfAbsent(Object key, Object value) throws IllegalArgumentException
      Specified by:
      putResourceIfAbsent in class AbstractTransaction
      Throws:
      IllegalArgumentException
    • isImported

      public boolean isImported()
      Determine if this transaction was imported.
      Returns:
      true if the transaction was imported, false if it was initiated locally
    • getProviderInterface

      public <T> T getProviderInterface(Class<T> providerInterfaceType)
      Description copied from class: AbstractTransaction
      Get a provider-specific interface from this transaction.
      Overrides:
      getProviderInterface in class AbstractTransaction
      Type Parameters:
      T - the provider interface type
      Parameters:
      providerInterfaceType - the provider interface type class (must not be null)
      Returns:
      the provider interface, or null if the given type isn't supported by this transaction's provider
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object