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
ConstructorDescriptionTransactionXaAdapter
(LocalXaTransaction localTransaction, XaTransactionTable txTable) TransactionXaAdapter
(XaTransactionTable txTable) -
Method Summary
Modifier and TypeMethodDescriptionasyncCommit
(XidImpl xid, boolean onePhase) asyncPrepare
(XidImpl xid) asyncRollback
(XidImpl xid) void
Same comment as forprepare(javax.transaction.xa.Xid)
applies for commit.void
boolean
void
int
boolean
isSameRM
(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.int
This can be call for any transaction object.Xid[]
recover
(int flag) void
Same comment as forprepare(javax.transaction.xa.Xid)
applies for commit.boolean
setTransactionTimeout
(int i) void
toString()
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:
prepare
in interfaceXAResource
- Throws:
XAException
-
commit
Same comment as forprepare(javax.transaction.xa.Xid)
applies for commit.- Specified by:
commit
in interfaceXAResource
- Throws:
XAException
-
rollback
Same comment as forprepare(javax.transaction.xa.Xid)
applies for commit.- Specified by:
rollback
in interfaceXAResource
- Throws:
XAException
-
start
- Specified by:
start
in interfaceXAResource
- Throws:
XAException
-
end
- Specified by:
end
in interfaceXAResource
-
forget
- Specified by:
forget
in interfaceXAResource
- Throws:
XAException
-
getTransactionTimeout
public int getTransactionTimeout()- Specified by:
getTransactionTimeout
in 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:
isSameRM
in interfaceXAResource
-
recover
- Specified by:
recover
in interfaceXAResource
-
setTransactionTimeout
public boolean setTransactionTimeout(int i) - Specified by:
setTransactionTimeout
in interfaceXAResource
-
toString
-
getLocalTransaction
-
equals
-
asyncEnd
- Specified by:
asyncEnd
in interfaceAsyncXaResource
- Returns:
- A
CompletionStage
which is completed with the result ofXAResource.end(Xid, int)
. - See Also:
-
asyncPrepare
- Specified by:
asyncPrepare
in interfaceAsyncXaResource
- Returns:
- A
CompletionStage
which is completed with the result ofXAResource.prepare(Xid)
. - See Also:
-
asyncCommit
- Specified by:
asyncCommit
in interfaceAsyncXaResource
- Returns:
- A
CompletionStage
which is completed with the result ofXAResource.commit(Xid, boolean)
- See Also:
-
asyncRollback
- Specified by:
asyncRollback
in interfaceAsyncXaResource
- Returns:
- A
CompletionStage
which is completed with the result ofXAResource.rollback(Xid)
- See Also:
-