Package org.infinispan.transaction.xa
Class TransactionXaAdapter
- java.lang.Object
-
- org.infinispan.transaction.impl.AbstractEnlistmentAdapter
-
- org.infinispan.transaction.xa.TransactionXaAdapter
-
- All Implemented Interfaces:
XAResource
public class TransactionXaAdapter extends org.infinispan.transaction.impl.AbstractEnlistmentAdapter implements XAResource
This acts both as an localCacheTransactionand implementor of anXAResourcethat will be called by tx manager on various tx stages.- Since:
- 4.0
- Author:
- Mircea.Markus@jboss.com
-
-
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 TransactionXaAdapter(LocalXaTransaction localTransaction, XaTransactionTable txTable)TransactionXaAdapter(XaTransactionTable txTable)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcommit(Xid externalXid, boolean isOnePhase)Same comment as forprepare(javax.transaction.xa.Xid)applies for commit.voidend(Xid externalXid, int i)booleanequals(Object o)voidforget(Xid externalXid)LocalXaTransactiongetLocalTransaction()intgetTransactionTimeout()booleanisSameRM(XAResource xaResource)the only situation in which it returns true is when the other xa resource pertains to the same cache, on the same node.intprepare(Xid externalXid)This can be call for any transaction object.Xid[]recover(int flag)voidrollback(Xid externalXid)Same comment as forprepare(javax.transaction.xa.Xid)applies for commit.booleansetTransactionTimeout(int i)voidstart(Xid externalXid, int i)StringtoString()
-
-
-
Constructor Detail
-
TransactionXaAdapter
public TransactionXaAdapter(LocalXaTransaction localTransaction, XaTransactionTable txTable)
-
TransactionXaAdapter
public TransactionXaAdapter(XaTransactionTable txTable)
-
-
Method Detail
-
prepare
public int prepare(Xid externalXid) throws XAException
This can be call for any transaction object. See Section 3.4.6 (Resource Sharing) from JTA spec v1.1.- Specified by:
preparein interfaceXAResource- Throws:
XAException
-
commit
public void commit(Xid externalXid, boolean isOnePhase) throws XAException
Same comment as forprepare(javax.transaction.xa.Xid)applies for commit.- Specified by:
commitin interfaceXAResource- Throws:
XAException
-
rollback
public void rollback(Xid externalXid) throws XAException
Same comment as forprepare(javax.transaction.xa.Xid)applies for commit.- Specified by:
rollbackin interfaceXAResource- Throws:
XAException
-
start
public void start(Xid externalXid, int i) throws XAException
- Specified by:
startin interfaceXAResource- Throws:
XAException
-
end
public void end(Xid externalXid, int i) throws XAException
- Specified by:
endin interfaceXAResource- Throws:
XAException
-
forget
public void forget(Xid externalXid) throws XAException
- Specified by:
forgetin interfaceXAResource- Throws:
XAException
-
getTransactionTimeout
public int getTransactionTimeout() throws XAException- Specified by:
getTransactionTimeoutin interfaceXAResource- Throws:
XAException
-
isSameRM
public boolean isSameRM(XAResource xaResource) throws XAException
the only situation in which it returns true is when the other xa resource pertains to the same cache, on the same node.- Specified by:
isSameRMin interfaceXAResource- Throws:
XAException
-
recover
public Xid[] recover(int flag) throws XAException
- Specified by:
recoverin interfaceXAResource- Throws:
XAException
-
setTransactionTimeout
public boolean setTransactionTimeout(int i) throws XAException- Specified by:
setTransactionTimeoutin interfaceXAResource- Throws:
XAException
-
getLocalTransaction
public LocalXaTransaction getLocalTransaction()
-
-