org.infinispan.transaction
Class AbstractCacheTransaction

java.lang.Object
  extended by org.infinispan.transaction.AbstractCacheTransaction
All Implemented Interfaces:
CacheTransaction
Direct Known Subclasses:
LocalTransaction, RemoteTransaction

public abstract class AbstractCacheTransaction
extends Object
implements CacheTransaction

Base class for local and remote transaction. Impl note: The aggregated modification list and lookedUpEntries are not instantiated here but in subclasses. This is done in order to take advantage of the fact that, for remote transactions we already know the size of the modifications list at creation time.

Since:
4.2
Author:
Mircea.Markus@jboss.com, Galder ZamarreƱo

Field Summary
protected  Set<Object> affectedKeys
           
protected  BidirectionalLinkedHashMap<Object,CacheEntry> lookedUpEntries
           
protected  List<WriteCommand> modifications
           
protected  boolean prepared
           
protected  GlobalTransaction tx
           
 
Constructor Summary
AbstractCacheTransaction()
           
 
Method Summary
 void clearLookedUpEntries()
           
 Set<Object> getAffectedKeys()
           
 GlobalTransaction getGlobalTransaction()
          Returns the transaction identifier.
 BidirectionalMap<Object,CacheEntry> getLookedUpEntries()
           
 List<WriteCommand> getModifications()
          Returns the modifications visible within the current transaction.
 CacheEntry lookupEntry(Object key)
           
 void removeLookedUpEntry(Object key)
           
 void setAffectedKeys(Set<Object> affectedKeys)
           
 void setLookedUpEntries(BidirectionalMap<Object,CacheEntry> lookedUpEntries)
           
 void setModifications(WriteCommand[] modifications)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.infinispan.transaction.xa.CacheTransaction
putLookedUpEntry
 

Field Detail

modifications

protected List<WriteCommand> modifications

lookedUpEntries

protected BidirectionalLinkedHashMap<Object,CacheEntry> lookedUpEntries

tx

protected GlobalTransaction tx

affectedKeys

protected Set<Object> affectedKeys

prepared

protected volatile boolean prepared
Constructor Detail

AbstractCacheTransaction

public AbstractCacheTransaction()
Method Detail

getGlobalTransaction

public GlobalTransaction getGlobalTransaction()
Description copied from interface: CacheTransaction
Returns the transaction identifier.

Specified by:
getGlobalTransaction in interface CacheTransaction

getModifications

public List<WriteCommand> getModifications()
Description copied from interface: CacheTransaction
Returns the modifications visible within the current transaction.

Specified by:
getModifications in interface CacheTransaction

setModifications

public void setModifications(WriteCommand[] modifications)

getLookedUpEntries

public BidirectionalMap<Object,CacheEntry> getLookedUpEntries()
Specified by:
getLookedUpEntries in interface CacheTransaction

lookupEntry

public CacheEntry lookupEntry(Object key)
Specified by:
lookupEntry 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

setLookedUpEntries

public void setLookedUpEntries(BidirectionalMap<Object,CacheEntry> lookedUpEntries)

getAffectedKeys

public Set<Object> getAffectedKeys()

setAffectedKeys

public void setAffectedKeys(Set<Object> affectedKeys)

-->

Copyright © 2011 JBoss, a division of Red Hat. All Rights Reserved.