Package org.jboss.narayana.jta.jms
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
-
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
ConstructorDescriptionJmsXAResourceRecoveryHelper
(jakarta.jms.XAConnectionFactory xaConnectionFactory) JmsXAResourceRecoveryHelper
(jakarta.jms.XAConnectionFactory xaConnectionFactory, String user, String pass) JmsXAResourceRecoveryHelper
(ConnectionManager connectionManager) -
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) Nothing to initialise.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) -
JmsXAResourceRecoveryHelper
-
JmsXAResourceRecoveryHelper
-
-
Method Details
-
initialise
Nothing to initialise.- Specified by:
initialise
in interfaceXAResourceRecoveryHelper
- Parameters:
properties
-- Returns:
- Always returns true
-
getXAResources
If JMS connection was created successfully, returns an array with one instance of JmsXAResourceRecoveryHelper. Otherwise, returns an empty array.- Specified by:
getXAResources
in interfaceXAResourceRecoveryHelper
- 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
- Parameters:
flag
-- Throws:
XAException
-
start
Delegates XAResource#start call to the connected JMS resource.- Specified by:
start
in interfaceXAResource
- Parameters:
xid
-flag
-- Throws:
XAException
-
end
Delegates XAResource#end call to the connected JMS resource.- Specified by:
end
in interfaceXAResource
- Parameters:
xid
-flag
-- Throws:
XAException
-
prepare
Delegates XAResource#prepare call to the connected JMS resource.- Specified by:
prepare
in interfaceXAResource
- Parameters:
xid
-- Returns:
- Prepare outcome
- Throws:
XAException
-
commit
Delegates XAResource#commit call to the connected JMS resource.- Specified by:
commit
in interfaceXAResource
- Parameters:
xid
-onePhase
-- Throws:
XAException
-
rollback
Delegates XAResource#rollback call to the connected JMS resource.- Specified by:
rollback
in interfaceXAResource
- Parameters:
xid
-- Throws:
XAException
-
isSameRM
Delegates XAResource#isSameRM call to the connected JMS resource.- Specified by:
isSameRM
in interfaceXAResource
- Parameters:
xaResource
-- 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
- Parameters:
xid
-- 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
- Parameters:
seconds
-- Returns:
- True if transaction timeout was set, or false if wasn't.
- Throws:
XAException
-