Class JmsXAResourceRecoveryHelper

java.lang.Object
org.frankframework.jta.narayana.JmsXAResourceRecoveryHelper
All Implemented Interfaces:
com.arjuna.ats.jta.recovery.XAResourceRecoveryHelper, XAResource, org.jboss.tm.XAResourceWrapper

public class JmsXAResourceRecoveryHelper extends Object implements com.arjuna.ats.jta.recovery.XAResourceRecoveryHelper, XAResource, org.jboss.tm.XAResourceWrapper
XAResourceRecoveryHelper implementation which gets XIDs, which needs to be recovered. See org.jboss.narayana.jta.jms.JmsXAResourceRecoveryHelper. Required as we wrap the connection in a pooling-capable factory, and do not use the native Narayana connection factory. Additionally this also implements `XAResourceWrapper`, which (AFAIK) only adds debug info. See XAResourceRecord#getJndiName()
Author:
Gytis Trikleris, Niels Meijer
  • Constructor Details

    • JmsXAResourceRecoveryHelper

      public JmsXAResourceRecoveryHelper(jakarta.jms.XAConnectionFactory xaConnectionFactory, String name)
  • Method Details

    • initialise

      public boolean initialise(String properties)
      Specified by:
      initialise in interface com.arjuna.ats.jta.recovery.XAResourceRecoveryHelper
    • 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 com.arjuna.ats.jta.recovery.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
      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
      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
      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
      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
      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
      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
      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
      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
      Returns:
      True if transaction timeout was set, or false if wasn't.
      Throws:
      XAException
    • getResource

      public XAResource getResource()
      Specified by:
      getResource in interface org.jboss.tm.XAResourceWrapper
    • getProductName

      public String getProductName()
      Specified by:
      getProductName in interface org.jboss.tm.XAResourceWrapper
    • getProductVersion

      public String getProductVersion()
      Specified by:
      getProductVersion in interface org.jboss.tm.XAResourceWrapper
    • getJndiName

      public String getJndiName()
      Specified by:
      getJndiName in interface org.jboss.tm.XAResourceWrapper