org.infinispan.transaction.xa
Class TransactionXaAdapter
java.lang.Object
org.infinispan.transaction.xa.TransactionXaAdapter
- All Implemented Interfaces:
- XAResource, CacheTransaction
public class TransactionXaAdapter
- extends Object
- implements CacheTransaction, XAResource
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
Fields inherited from interface javax.transaction.xa.XAResource |
TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY |
TransactionXaAdapter
public TransactionXaAdapter(GlobalTransaction globalTx,
InvocationContextContainer icc,
InterceptorChain invoker,
CommandsFactory commandsFactory,
Configuration configuration,
TransactionTable txTable,
Transaction transaction)
addModification
public void addModification(WriteCommand mod)
prepare
public int prepare(Xid xid)
throws XAException
- Specified by:
prepare
in interface XAResource
- Throws:
XAException
commit
public void commit(Xid xid,
boolean isOnePhase)
throws XAException
- Specified by:
commit
in interface XAResource
- Throws:
XAException
rollback
public void rollback(Xid xid)
throws XAException
- Specified by:
rollback
in interface XAResource
- Throws:
XAException
start
public void start(Xid xid,
int i)
throws XAException
- Specified by:
start
in interface XAResource
- Throws:
XAException
end
public void end(Xid xid,
int i)
throws XAException
- Specified by:
end
in interface XAResource
- Throws:
XAException
forget
public void forget(Xid xid)
throws XAException
- Specified by:
forget
in interface XAResource
- Throws:
XAException
getTransactionTimeout
public int getTransactionTimeout()
throws XAException
- Specified by:
getTransactionTimeout
in interface XAResource
- Throws:
XAException
isSameRM
public boolean isSameRM(XAResource xaResource)
throws XAException
- Specified by:
isSameRM
in interface XAResource
- Throws:
XAException
recover
public Xid[] recover(int i)
throws XAException
- Specified by:
recover
in interface XAResource
- Throws:
XAException
setTransactionTimeout
public boolean setTransactionTimeout(int i)
throws XAException
- Specified by:
setTransactionTimeout
in interface XAResource
- Throws:
XAException
putLookedUpEntries
public void putLookedUpEntries(Map<Object,CacheEntry> entries)
- Specified by:
putLookedUpEntries
in interface CacheTransaction
lookupEntry
public CacheEntry lookupEntry(Object key)
- Specified by:
lookupEntry
in interface CacheTransaction
getLookedUpEntries
public BidirectionalMap<Object,CacheEntry> getLookedUpEntries()
- Specified by:
getLookedUpEntries
in interface CacheTransaction
putLookedUpEntry
public void putLookedUpEntry(Object key,
CacheEntry e)
- Specified by:
putLookedUpEntry
in interface CacheTransaction
getGlobalTx
public GlobalTransaction getGlobalTx()
getModifications
public List<WriteCommand> getModifications()
- Description copied from interface:
CacheTransaction
- Returns the modifications visible within the current transaction.
- Specified by:
getModifications
in interface CacheTransaction
getTransaction
public Transaction getTransaction()
getGlobalTransaction
public GlobalTransaction getGlobalTransaction()
- Description copied from interface:
CacheTransaction
- Returns the transaction identifier.
- Specified by:
getGlobalTransaction
in interface CacheTransaction
removeLookedUpEntry
public void removeLookedUpEntry(Object key)
- Specified by:
removeLookedUpEntry
in interface CacheTransaction
clearLookedUpEntries
public void clearLookedUpEntries()
- Specified by:
clearLookedUpEntries
in interface CacheTransaction
equals
public boolean equals(Object o)
- Overrides:
equals
in class Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2010 JBoss, a division of Red Hat. All Rights Reserved.