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
Constructors Constructor Description JmsXAResourceRecoveryHelper(jakarta.jms.XAConnectionFactory xaConnectionFactory)JmsXAResourceRecoveryHelper(jakarta.jms.XAConnectionFactory xaConnectionFactory, String user, String pass)JmsXAResourceRecoveryHelper(ConnectionManager connectionManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcommit(Xid xid, boolean onePhase)Delegates XAResource#commit call to the connected JMS resource.voidend(Xid xid, int flag)Delegates XAResource#end call to the connected JMS resource.voidforget(Xid xid)Delegates XAResource#forget call to the connected JMS resource.intgetTransactionTimeout()Delegates XAResource#getTransactionTimeout call to the connected JMS resource.XAResource[]getXAResources()If JMS connection was created successfully, returns an array with one instance of JmsXAResourceRecoveryHelper.booleaninitialise(String properties)Nothing to initialise.booleanisSameRM(XAResource xaResource)Delegates XAResource#isSameRM call to the connected JMS resource.intprepare(Xid xid)Delegates XAResource#prepare call to the connected JMS resource.Xid[]recover(int flag)Delegates XAResource#recover call to the connected JMS resource.voidrollback(Xid xid)Delegates XAResource#rollback call to the connected JMS resource.booleansetTransactionTimeout(int seconds)Delegates XAResource#setTransactionTimeout call to the connected JMS resource.voidstart(Xid xid, int flag)Delegates XAResource#start call to the connected JMS resource.
-
-
-
Constructor Detail
-
JmsXAResourceRecoveryHelper
public JmsXAResourceRecoveryHelper(jakarta.jms.XAConnectionFactory xaConnectionFactory)
-
JmsXAResourceRecoveryHelper
public JmsXAResourceRecoveryHelper(jakarta.jms.XAConnectionFactory xaConnectionFactory, String user, String pass)
-
JmsXAResourceRecoveryHelper
public JmsXAResourceRecoveryHelper(ConnectionManager connectionManager)
-
-
Method Detail
-
initialise
public boolean initialise(String properties)
Nothing to initialise.- Specified by:
initialisein interfaceXAResourceRecoveryHelper- Parameters:
properties-- Returns:
- Always returns true
-
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:
getXAResourcesin interfaceXAResourceRecoveryHelper- 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:
recoverin interfaceXAResource- Parameters:
flag-- Throws:
XAException
-
start
public void start(Xid xid, int flag) throws XAException
Delegates XAResource#start call to the connected JMS resource.- Specified by:
startin interfaceXAResource- Parameters:
xid-flag-- Throws:
XAException
-
end
public void end(Xid xid, int flag) throws XAException
Delegates XAResource#end call to the connected JMS resource.- Specified by:
endin interfaceXAResource- Parameters:
xid-flag-- Throws:
XAException
-
prepare
public int prepare(Xid xid) throws XAException
Delegates XAResource#prepare call to the connected JMS resource.- Specified by:
preparein interfaceXAResource- Parameters:
xid-- 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:
commitin interfaceXAResource- Parameters:
xid-onePhase-- Throws:
XAException
-
rollback
public void rollback(Xid xid) throws XAException
Delegates XAResource#rollback call to the connected JMS resource.- Specified by:
rollbackin interfaceXAResource- Parameters:
xid-- Throws:
XAException
-
isSameRM
public boolean isSameRM(XAResource xaResource) throws XAException
Delegates XAResource#isSameRM call to the connected JMS resource.- Specified by:
isSameRMin interfaceXAResource- Parameters:
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:
forgetin interfaceXAResource- Parameters:
xid-- Throws:
XAException
-
getTransactionTimeout
public int getTransactionTimeout() throws XAExceptionDelegates XAResource#getTransactionTimeout call to the connected JMS resource.- Specified by:
getTransactionTimeoutin interfaceXAResource- Returns:
- Transaction timeout value.
- Throws:
XAException
-
setTransactionTimeout
public boolean setTransactionTimeout(int seconds) throws XAExceptionDelegates XAResource#setTransactionTimeout call to the connected JMS resource.- Specified by:
setTransactionTimeoutin interfaceXAResource- Parameters:
seconds-- Returns:
- True if transaction timeout was set, or false if wasn't.
- Throws:
XAException
-
-