Class JmsXAResourceRecoveryHelper

java.lang.Object
org.jboss.narayana.jta.jms.JmsXAResourceRecoveryHelper
All Implemented Interfaces:
XAResourceRecoveryHelper, XAResource

public class JmsXAResourceRecoveryHelper extends Object implements XAResourceRecoveryHelper, XAResource
Author:
Gytis Trikleris
  • Constructor Details

    • JmsXAResourceRecoveryHelper

      public JmsXAResourceRecoveryHelper(jakarta.jms.XAConnectionFactory xaConnectionFactory)
    • JmsXAResourceRecoveryHelper

      public JmsXAResourceRecoveryHelper(jakarta.jms.XAConnectionFactory xaConnectionFactory, String user, String pass)
    • JmsXAResourceRecoveryHelper

      public JmsXAResourceRecoveryHelper(ConnectionManager connectionManager)
  • Method Details

    • initialise

      public boolean initialise(String properties)
      Nothing to initialise.
      Specified by:
      initialise in interface XAResourceRecoveryHelper
      Parameters:
      properties -
      Returns:
      Always returns true
    • getXAResources

      public XAResource[] getXAResources()
      If JMS connection was created successfully, returns an array with one instance of JmsXAResourceRecoveryHelper. Otherwise, returns an empty array.
      Specified by:
      getXAResources in interface XAResourceRecoveryHelper
      Returns:
      Array with one instance of JmsXAResourceRecoveryHelper or an empty array
    • recover

      public Xid[] recover(int flag) throws XAException
      Delegates XAResource#recover call to the connected JMS resource. If provided argument is XAResource.TMENDRSCAN, then JMS connection will be closed at the end of the call.
      Specified by:
      recover in interface XAResource
      Parameters:
      flag -
      Throws:
      XAException
    • start

      public void start(Xid xid, int flag) throws XAException
      Delegates XAResource#start call to the connected JMS resource.
      Specified by:
      start in interface XAResource
      Parameters:
      xid -
      flag -
      Throws:
      XAException
    • end

      public void end(Xid xid, int flag) throws XAException
      Delegates XAResource#end call to the connected JMS resource.
      Specified by:
      end in interface XAResource
      Parameters:
      xid -
      flag -
      Throws:
      XAException
    • prepare

      public int prepare(Xid xid) throws XAException
      Delegates XAResource#prepare call to the connected JMS resource.
      Specified by:
      prepare in interface XAResource
      Parameters:
      xid -
      Returns:
      Prepare outcome
      Throws:
      XAException
    • commit

      public void commit(Xid xid, boolean onePhase) throws XAException
      Delegates XAResource#commit call to the connected JMS resource.
      Specified by:
      commit in interface XAResource
      Parameters:
      xid -
      onePhase -
      Throws:
      XAException
    • rollback

      public void rollback(Xid xid) throws XAException
      Delegates XAResource#rollback call to the connected JMS resource.
      Specified by:
      rollback in interface XAResource
      Parameters:
      xid -
      Throws:
      XAException
    • isSameRM

      public boolean isSameRM(XAResource xaResource) throws XAException
      Delegates XAResource#isSameRM call to the connected JMS resource.
      Specified by:
      isSameRM in interface XAResource
      Parameters:
      xaResource -
      Returns:
      True if is same resource manager or false if not.
      Throws:
      XAException
    • forget

      public void forget(Xid xid) throws XAException
      Delegates XAResource#forget call to the connected JMS resource.
      Specified by:
      forget in interface XAResource
      Parameters:
      xid -
      Throws:
      XAException
    • getTransactionTimeout

      public int getTransactionTimeout() throws XAException
      Delegates XAResource#getTransactionTimeout call to the connected JMS resource.
      Specified by:
      getTransactionTimeout in interface XAResource
      Returns:
      Transaction timeout value.
      Throws:
      XAException
    • setTransactionTimeout

      public boolean setTransactionTimeout(int seconds) throws XAException
      Delegates XAResource#setTransactionTimeout call to the connected JMS resource.
      Specified by:
      setTransactionTimeout in interface XAResource
      Parameters:
      seconds -
      Returns:
      True if transaction timeout was set, or false if wasn't.
      Throws:
      XAException