Package org.infinispan.transaction.xa
Class TransactionXaAdapter
java.lang.Object
org.infinispan.transaction.impl.AbstractEnlistmentAdapter
org.infinispan.transaction.xa.TransactionXaAdapter
- All Implemented Interfaces:
XAResource,AsyncXaResource
public class TransactionXaAdapter
extends AbstractEnlistmentAdapter
implements XAResource, AsyncXaResource
This acts both as an local
CacheTransaction and implementor of an XAResource that 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
ConstructorsConstructorDescriptionTransactionXaAdapter(LocalXaTransaction localTransaction, XaTransactionTable txTable) TransactionXaAdapter(XaTransactionTable txTable) -
Method Summary
Modifier and TypeMethodDescriptionasyncCommit(XidImpl xid, boolean onePhase) asyncPrepare(XidImpl xid) asyncRollback(XidImpl xid) voidSame comment as forprepare(javax.transaction.xa.Xid)applies for commit.voidbooleanvoidintbooleanisSameRM(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.intThis can be call for any transaction object.Xid[]recover(int flag) voidSame comment as forprepare(javax.transaction.xa.Xid)applies for commit.booleansetTransactionTimeout(int i) voidtoString()Methods inherited from class org.infinispan.transaction.impl.AbstractEnlistmentAdapter
hashCode
-
Constructor Details
-
TransactionXaAdapter
-
TransactionXaAdapter
-
-
Method Details
-
prepare
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
Same comment as forprepare(javax.transaction.xa.Xid)applies for commit.- Specified by:
commitin interfaceXAResource- Throws:
XAException
-
rollback
Same comment as forprepare(javax.transaction.xa.Xid)applies for commit.- Specified by:
rollbackin interfaceXAResource- Throws:
XAException
-
start
- Specified by:
startin interfaceXAResource- Throws:
XAException
-
end
- Specified by:
endin interfaceXAResource
-
forget
- Specified by:
forgetin interfaceXAResource- Throws:
XAException
-
getTransactionTimeout
public int getTransactionTimeout()- Specified by:
getTransactionTimeoutin interfaceXAResource
-
isSameRM
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
-
recover
- Specified by:
recoverin interfaceXAResource
-
setTransactionTimeout
public boolean setTransactionTimeout(int i) - Specified by:
setTransactionTimeoutin interfaceXAResource
-
toString
-
getLocalTransaction
-
equals
-
asyncEnd
- Specified by:
asyncEndin interfaceAsyncXaResource- Returns:
- A
CompletionStagewhich is completed with the result ofXAResource.end(Xid, int). - See Also:
-
asyncPrepare
- Specified by:
asyncPreparein interfaceAsyncXaResource- Returns:
- A
CompletionStagewhich is completed with the result ofXAResource.prepare(Xid). - See Also:
-
asyncCommit
- Specified by:
asyncCommitin interfaceAsyncXaResource- Returns:
- A
CompletionStagewhich is completed with the result ofXAResource.commit(Xid, boolean) - See Also:
-
asyncRollback
- Specified by:
asyncRollbackin interfaceAsyncXaResource- Returns:
- A
CompletionStagewhich is completed with the result ofXAResource.rollback(Xid) - See Also:
-