Class ActiveMQRAXAResource

java.lang.Object
org.apache.activemq.artemis.ra.ActiveMQRAXAResource
All Implemented Interfaces:
XAResource, ActiveMQXAResource

public class ActiveMQRAXAResource extends Object implements ActiveMQXAResource
ActiveMQXAResource.
  • Constructor Details

  • Method Details

    • start

      public void start(Xid xid, int flags) throws XAException
      Start
      Specified by:
      start in interface XAResource
      Parameters:
      xid - A global transaction identifier
      flags - One of TMNOFLAGS, TMJOIN, or TMRESUME
      Throws:
      XAException - An error has occurred
    • end

      public void end(Xid xid, int flags) throws XAException
      End
      Specified by:
      end in interface XAResource
      Parameters:
      xid - A global transaction identifier
      flags - One of TMSUCCESS, TMFAIL, or TMSUSPEND.
      Throws:
      XAException - An error has occurred
    • prepare

      public int prepare(Xid xid) throws XAException
      Prepare
      Specified by:
      prepare in interface XAResource
      Parameters:
      xid - A global transaction identifier
      Returns:
      XA_RDONLY or XA_OK
      Throws:
      XAException - An error has occurred
    • commit

      public void commit(Xid xid, boolean onePhase) throws XAException
      Commit
      Specified by:
      commit in interface XAResource
      Parameters:
      xid - A global transaction identifier
      onePhase - If true, the resource manager should use a one-phase commit protocol to commit the work done on behalf of xid.
      Throws:
      XAException - An error has occurred
    • rollback

      public void rollback(Xid xid) throws XAException
      Rollback
      Specified by:
      rollback in interface XAResource
      Parameters:
      xid - A global transaction identifier
      Throws:
      XAException - An error has occurred
    • forget

      public void forget(Xid xid) throws XAException
      Forget
      Specified by:
      forget in interface XAResource
      Parameters:
      xid - A global transaction identifier
      Throws:
      XAException - An error has occurred
    • isSameRM

      public boolean isSameRM(XAResource xaRes) throws XAException
      IsSameRM
      Specified by:
      isSameRM in interface XAResource
      Parameters:
      xaRes - An XAResource object whose resource manager instance is to be compared with the resource manager instance of the target object.
      Returns:
      true if its the same RM instance; otherwise false
      Throws:
      XAException - An error has occurred
    • recover

      public Xid[] recover(int flag) throws XAException
      Recover
      Specified by:
      recover in interface XAResource
      Parameters:
      flag - One of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS
      Returns:
      Zero or more XIDs
      Throws:
      XAException - An error has occurred
    • getTransactionTimeout

      public int getTransactionTimeout() throws XAException
      Get the transaction timeout in seconds
      Specified by:
      getTransactionTimeout in interface XAResource
      Returns:
      The transaction timeout
      Throws:
      XAException - An error has occurred
    • setTransactionTimeout

      public boolean setTransactionTimeout(int seconds) throws XAException
      Set the transaction timeout
      Specified by:
      setTransactionTimeout in interface XAResource
      Parameters:
      seconds - The number of seconds
      Returns:
      true if the transaction timeout value is set successfully; otherwise false
      Throws:
      XAException - An error has occurred
    • getResource

      public XAResource getResource()
      Specified by:
      getResource in interface ActiveMQXAResource