Package org.frankframework.jta.narayana
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
-
Field Summary
Fields inherited from interface javax.transaction.xa.XAResource
TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY
-
Constructor Summary
ConstructorsConstructorDescriptionJmsXAResourceRecoveryHelper
(jakarta.jms.XAConnectionFactory xaConnectionFactory, String name) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Delegates XAResource#commit call to the connected JMS resource.void
Delegates XAResource#end call to the connected JMS resource.void
Delegates XAResource#forget call to the connected JMS resource.int
Delegates XAResource#getTransactionTimeout call to the connected JMS resource.If JMS connection was created successfully, returns an array with one instance of JmsXAResourceRecoveryHelper.boolean
initialise
(String properties) boolean
isSameRM
(XAResource xaResource) Delegates XAResource#isSameRM call to the connected JMS resource.int
Delegates XAResource#prepare call to the connected JMS resource.Xid[]
recover
(int flag) Delegates XAResource#recover call to the connected JMS resource.void
Delegates XAResource#rollback call to the connected JMS resource.boolean
setTransactionTimeout
(int seconds) Delegates XAResource#setTransactionTimeout call to the connected JMS resource.void
Delegates XAResource#start call to the connected JMS resource.
-
Constructor Details
-
JmsXAResourceRecoveryHelper
public JmsXAResourceRecoveryHelper(jakarta.jms.XAConnectionFactory xaConnectionFactory, String name)
-
-
Method Details
-
initialise
- Specified by:
initialise
in interfacecom.arjuna.ats.jta.recovery.XAResourceRecoveryHelper
-
getXAResources
If JMS connection was created successfully, returns an array with one instance of JmsXAResourceRecoveryHelper. Otherwise, returns an empty array.- Specified by:
getXAResources
in interfacecom.arjuna.ats.jta.recovery.XAResourceRecoveryHelper
- Returns:
- Array with one instance of JmsXAResourceRecoveryHelper or an empty array
-
recover
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 interfaceXAResource
- Throws:
XAException
-
start
Delegates XAResource#start call to the connected JMS resource.- Specified by:
start
in interfaceXAResource
- Throws:
XAException
-
end
Delegates XAResource#end call to the connected JMS resource.- Specified by:
end
in interfaceXAResource
- Throws:
XAException
-
prepare
Delegates XAResource#prepare call to the connected JMS resource.- Specified by:
prepare
in interfaceXAResource
- Returns:
- Prepare outcome
- Throws:
XAException
-
commit
Delegates XAResource#commit call to the connected JMS resource.- Specified by:
commit
in interfaceXAResource
- Throws:
XAException
-
rollback
Delegates XAResource#rollback call to the connected JMS resource.- Specified by:
rollback
in interfaceXAResource
- Throws:
XAException
-
isSameRM
Delegates XAResource#isSameRM call to the connected JMS resource.- Specified by:
isSameRM
in interfaceXAResource
- Returns:
- True if is same resource manager or false if not.
- Throws:
XAException
-
forget
Delegates XAResource#forget call to the connected JMS resource.- Specified by:
forget
in interfaceXAResource
- Throws:
XAException
-
getTransactionTimeout
Delegates XAResource#getTransactionTimeout call to the connected JMS resource.- Specified by:
getTransactionTimeout
in interfaceXAResource
- Returns:
- Transaction timeout value.
- Throws:
XAException
-
setTransactionTimeout
Delegates XAResource#setTransactionTimeout call to the connected JMS resource.- Specified by:
setTransactionTimeout
in interfaceXAResource
- Returns:
- True if transaction timeout was set, or false if wasn't.
- Throws:
XAException
-
getResource
- Specified by:
getResource
in interfaceorg.jboss.tm.XAResourceWrapper
-
getProductName
- Specified by:
getProductName
in interfaceorg.jboss.tm.XAResourceWrapper
-
getProductVersion
- Specified by:
getProductVersion
in interfaceorg.jboss.tm.XAResourceWrapper
-
getJndiName
- Specified by:
getJndiName
in interfaceorg.jboss.tm.XAResourceWrapper
-