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 localCacheTransaction
and implementor of anXAResource
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
Constructors Constructor Description TransactionXaAdapter(LocalXaTransaction localTransaction, XaTransactionTable txTable)
TransactionXaAdapter(XaTransactionTable txTable)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
commit(Xid externalXid, boolean isOnePhase)
Same comment as forprepare(javax.transaction.xa.Xid)
applies for commit.void
end(Xid externalXid, int i)
boolean
equals(Object o)
void
forget(Xid externalXid)
LocalXaTransaction
getLocalTransaction()
int
getTransactionTimeout()
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
prepare(Xid externalXid)
This can be call for any transaction object.Xid[]
recover(int flag)
void
rollback(Xid externalXid)
Same comment as forprepare(javax.transaction.xa.Xid)
applies for commit.boolean
setTransactionTimeout(int i)
void
start(Xid externalXid, int i)
String
toString()
-
-
-
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:
prepare
in 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:
commit
in interfaceXAResource
- Throws:
XAException
-
rollback
public void rollback(Xid externalXid) throws XAException
Same comment as forprepare(javax.transaction.xa.Xid)
applies for commit.- Specified by:
rollback
in interfaceXAResource
- Throws:
XAException
-
start
public void start(Xid externalXid, int i) throws XAException
- Specified by:
start
in interfaceXAResource
- Throws:
XAException
-
end
public void end(Xid externalXid, int i) throws XAException
- Specified by:
end
in interfaceXAResource
- Throws:
XAException
-
forget
public void forget(Xid externalXid) throws XAException
- Specified by:
forget
in interfaceXAResource
- Throws:
XAException
-
getTransactionTimeout
public int getTransactionTimeout() throws XAException
- Specified by:
getTransactionTimeout
in 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:
isSameRM
in interfaceXAResource
- Throws:
XAException
-
recover
public Xid[] recover(int flag) throws XAException
- Specified by:
recover
in interfaceXAResource
- Throws:
XAException
-
setTransactionTimeout
public boolean setTransactionTimeout(int i) throws XAException
- Specified by:
setTransactionTimeout
in interfaceXAResource
- Throws:
XAException
-
getLocalTransaction
public LocalXaTransaction getLocalTransaction()
-
-