Package org.apache.activemq.artemis.ra
Class ActiveMQRAXAResource
java.lang.Object
org.apache.activemq.artemis.ra.ActiveMQRAXAResource
- All Implemented Interfaces:
XAResource,ActiveMQXAResource
ActiveMQXAResource.
-
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
ConstructorsConstructorDescriptionActiveMQRAXAResource(ActiveMQRAManagedConnection managedConnection, XAResource xaResource) -
Method Summary
Modifier and TypeMethodDescriptionvoidCommitvoidEndvoidForgetintGet the transaction timeout in secondsbooleanisSameRM(XAResource xaRes) IsSameRMintPrepareXid[]recover(int flag) RecovervoidRollbackbooleansetTransactionTimeout(int seconds) Set the transaction timeoutvoidStart
-
Constructor Details
-
ActiveMQRAXAResource
-
-
Method Details
-
start
Start- Specified by:
startin interfaceXAResource- Parameters:
xid- A global transaction identifierflags- One of TMNOFLAGS, TMJOIN, or TMRESUME- Throws:
XAException- An error has occurred
-
end
End- Specified by:
endin interfaceXAResource- Parameters:
xid- A global transaction identifierflags- One of TMSUCCESS, TMFAIL, or TMSUSPEND.- Throws:
XAException- An error has occurred
-
prepare
Prepare- Specified by:
preparein interfaceXAResource- Parameters:
xid- A global transaction identifier- Returns:
- XA_RDONLY or XA_OK
- Throws:
XAException- An error has occurred
-
commit
Commit- Specified by:
commitin interfaceXAResource- Parameters:
xid- A global transaction identifieronePhase- Iftrue, 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
Rollback- Specified by:
rollbackin interfaceXAResource- Parameters:
xid- A global transaction identifier- Throws:
XAException- An error has occurred
-
forget
Forget- Specified by:
forgetin interfaceXAResource- Parameters:
xid- A global transaction identifier- Throws:
XAException- An error has occurred
-
isSameRM
IsSameRM- Specified by:
isSameRMin interfaceXAResource- Parameters:
xaRes- An XAResource object whose resource manager instance is to be compared with the resource manager instance of the target object.- Returns:
trueif its the same RM instance; otherwise false- Throws:
XAException- An error has occurred
-
recover
Recover- Specified by:
recoverin interfaceXAResource- Parameters:
flag- One of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS- Returns:
- Zero or more XIDs
- Throws:
XAException- An error has occurred
-
getTransactionTimeout
Get the transaction timeout in seconds- Specified by:
getTransactionTimeoutin interfaceXAResource- Returns:
- The transaction timeout
- Throws:
XAException- An error has occurred
-
setTransactionTimeout
Set the transaction timeout- Specified by:
setTransactionTimeoutin interfaceXAResource- Parameters:
seconds- The number of seconds- Returns:
trueif the transaction timeout value is set successfully; otherwise false- Throws:
XAException- An error has occurred
-
getResource
- Specified by:
getResourcein interfaceActiveMQXAResource
-