org.infinispan.transaction
Class AbstractCacheTransaction
java.lang.Object
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
tx
protected final GlobalTransaction tx
modifications
protected List<WriteCommand> modifications
lookedUpEntries
protected HashMap<Object,CacheEntry> lookedUpEntries
affectedKeys
protected Set<Object> affectedKeys
lockedKeys
protected Set<Object> lockedKeys
backupKeyLocks
protected Set<Object> backupKeyLocks
prepared
protected volatile boolean prepared
AbstractCacheTransaction
public AbstractCacheTransaction(GlobalTransaction tx,
int viewId)
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 Map<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
ownsLock
public boolean ownsLock(Object key)
- Specified by:
ownsLock
in interface CacheTransaction
notifyOnTransactionFinished
public void notifyOnTransactionFinished()
- Specified by:
notifyOnTransactionFinished
in interface CacheTransaction
- See Also:
AbstractTxLockingInterceptor.lockKeyAndCheckOwnership(org.infinispan.context.InvocationContext, Object)
waitForLockRelease
public boolean waitForLockRelease(Object key,
long lockAcquisitionTimeout)
throws InterruptedException
- Specified by:
waitForLockRelease
in interface CacheTransaction
- Throws:
InterruptedException
- See Also:
AbstractTxLockingInterceptor.lockKeyAndCheckOwnership(org.infinispan.context.InvocationContext, Object)
getViewId
public int getViewId()
- Specified by:
getViewId
in interface CacheTransaction
addBackupLockForKey
public void addBackupLockForKey(Object key)
- Specified by:
addBackupLockForKey
in interface CacheTransaction
registerLockedKey
public void registerLockedKey(Object key)
getLockedKeys
public Set<Object> getLockedKeys()
- Specified by:
getLockedKeys
in interface CacheTransaction
clearLockedKeys
public void clearLockedKeys()
- Specified by:
clearLockedKeys
in interface CacheTransaction
getAffectedKeys
public Set<Object> getAffectedKeys()
addAffectedKey
public void addAffectedKey(Object key)
addAllAffectedKeys
public void addAllAffectedKeys(Collection<Object> keys)
getUpdatedEntryVersions
public EntryVersionsMap getUpdatedEntryVersions()
- Specified by:
getUpdatedEntryVersions
in interface CacheTransaction
setUpdatedEntryVersions
public void setUpdatedEntryVersions(EntryVersionsMap updatedEntryVersions)
- Specified by:
setUpdatedEntryVersions
in interface CacheTransaction
addReadKey
public void addReadKey(Object key)
- Specified by:
addReadKey
in interface CacheTransaction
keyRead
public boolean keyRead(Object key)
- Specified by:
keyRead
in interface CacheTransaction
Copyright © 2012 JBoss, a division of Red Hat. All Rights Reserved.