Class RemoteTransaction

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

public final class RemoteTransaction extends AbstractTransaction
Author:
David M. Lloyd
  • Method Details

    • 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
    • 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
    • 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
    • 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()
    • enlistResource

      public boolean enlistResource(XAResource xaRes)
    • delistResource

      public boolean delistResource(XAResource xaRes, int flag)
    • registerSynchronization

      public void registerSynchronization(jakarta.transaction.Synchronization sync) throws jakarta.transaction.RollbackException, IllegalStateException, jakarta.transaction.SystemException
      Throws:
      jakarta.transaction.RollbackException
      IllegalStateException
      jakarta.transaction.SystemException
    • 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
    • getLocation

      public URI getLocation()
      Get the location of this remote transaction.
      Returns:
      the location of this remote transaction, or null if it has no location as of yet
    • setLocation

      public void setLocation(URI location) throws IllegalArgumentException, IllegalStateException, jakarta.transaction.SystemException
      Attempt to set the location of this transaction, binding it to a remote transport provider.
      Parameters:
      location - the location to set (must not be null)
      Throws:
      IllegalArgumentException - if there is no provider for the given location (or it is null), or the security context was invalid
      IllegalStateException - if the transaction is in an invalid state for setting its location
      jakarta.transaction.SystemException - if the transport could not begin the transaction
    • tryClearLocation

      public boolean tryClearLocation()
      Attempt to clear the location set on this transaction, disassociating it with the remote transport provider. There is only a limited time window at which this can occur, before the transaction is ever used. Typically this is only useful for retrying an initial invocation on a transaction.
      Returns:
      whether the attempt was successful