org.ehcache.transactions.xa
Class XATransactionContext<K,V>
java.lang.Object
org.ehcache.transactions.xa.XATransactionContext<K,V>
public class XATransactionContext<K,V>
- extends java.lang.Object
Context holder of an in-flight XA transaction. Modifications to the XAStore
are registered in an instance
of this class in the form of Command
s and can then be applied to the Store
backing the XAStore
in the form of SoftLock
s.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
hasTimedOut
public boolean hasTimedOut()
getTransactionId
public TransactionId getTransactionId()
addCommand
public void addCommand(K key,
Command<V> command)
newValueHolders
public java.util.Map<K,XAValueHolder<V>> newValueHolders()
touched
public boolean touched(K key)
removed
public boolean removed(K key)
updated
public boolean updated(K key)
evicted
public boolean evicted(K key)
oldValueOf
public V oldValueOf(K key)
newValueHolderOf
public XAValueHolder<V> newValueHolderOf(K key)
newValueOf
public V newValueOf(K key)
prepare
public int prepare()
throws CacheAccessException,
java.lang.IllegalStateException,
org.ehcache.transactions.xa.XATransactionContext.TransactionTimeoutException
- Throws:
CacheAccessException
java.lang.IllegalStateException
org.ehcache.transactions.xa.XATransactionContext.TransactionTimeoutException
commit
public void commit(boolean recovering)
throws CacheAccessException,
java.lang.IllegalStateException,
java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalStateException
- if the transaction ID is unknown
java.lang.IllegalArgumentException
- if the transaction ID has not been prepared
CacheAccessException
commitInOnePhase
public void commitInOnePhase()
throws CacheAccessException,
java.lang.IllegalStateException,
org.ehcache.transactions.xa.XATransactionContext.TransactionTimeoutException
- Throws:
CacheAccessException
java.lang.IllegalStateException
org.ehcache.transactions.xa.XATransactionContext.TransactionTimeoutException
rollback
public void rollback(boolean recovering)
throws CacheAccessException,
java.lang.IllegalStateException
- Throws:
java.lang.IllegalStateException
- if the transaction ID is unknown
CacheAccessException