Class ActiveMQXAResourceWrapper
java.lang.Object
org.apache.activemq.artemis.service.extensions.xa.recovery.ActiveMQXAResourceWrapper
- All Implemented Interfaces:
XAResource,SessionFailureListener,org.apache.activemq.artemis.core.remoting.FailureListener
XAResourceWrapper.
Mainly from org.jboss.server.XAResourceWrapper from the JBoss AS server module
The reason why we don't use that class directly is that it assumes on failure of connection the RM_FAIL or RM_ERR is thrown, but in ActiveMQ Artemis we throw XA_RETRY since we want the recovery manager to be able to retry on failure without having to manually retry
-
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected XAExceptioncheck(XAException e) Check whether an XAException is fatal.voidclose()Close the connectionvoidprotected XAResourceconnect()Connect to the server if not already done sovoidconnectionFailed(ActiveMQException me, boolean failedOver) voidconnectionFailed(ActiveMQException me, boolean failedOver, String scaleDownTargetNodeID) voidvoidintbooleanisSameRM(XAResource xaRes) intXid[]recover(int flag) voidbooleansetTransactionTimeout(int seconds) voidtoString()voidupdateRecoveryConfig(XARecoveryConfig... xaRecoveryConfigs)
-
Constructor Details
-
ActiveMQXAResourceWrapper
-
-
Method Details
-
updateRecoveryConfig
-
recover
- Specified by:
recoverin interfaceXAResource- Throws:
XAException
-
commit
- Specified by:
commitin interfaceXAResource- Throws:
XAException
-
rollback
- Specified by:
rollbackin interfaceXAResource- Throws:
XAException
-
forget
- Specified by:
forgetin interfaceXAResource- Throws:
XAException
-
isSameRM
- Specified by:
isSameRMin interfaceXAResource- Throws:
XAException
-
prepare
- Specified by:
preparein interfaceXAResource- Throws:
XAException
-
start
- Specified by:
startin interfaceXAResource- Throws:
XAException
-
end
- Specified by:
endin interfaceXAResource- Throws:
XAException
-
getTransactionTimeout
- Specified by:
getTransactionTimeoutin interfaceXAResource- Throws:
XAException
-
setTransactionTimeout
- Specified by:
setTransactionTimeoutin interfaceXAResource- Throws:
XAException
-
connectionFailed
- Specified by:
connectionFailedin interfaceorg.apache.activemq.artemis.core.remoting.FailureListener
-
connectionFailed
public void connectionFailed(ActiveMQException me, boolean failedOver, String scaleDownTargetNodeID) - Specified by:
connectionFailedin interfaceorg.apache.activemq.artemis.core.remoting.FailureListener
-
beforeReconnect
- Specified by:
beforeReconnectin interfaceSessionFailureListener
-
connect
Connect to the server if not already done so- Returns:
- the connectionFactory XAResource
- Throws:
Exception- for any problem
-
toString
-
close
public void close()Close the connection -
check
Check whether an XAException is fatal. If it is an RM problem we close the connection so the next call will reconnect.- Parameters:
e- the xa exception- Returns:
- never
- Throws:
XAException- always
-