public abstract class AbstractCacheTransaction extends Object implements CacheTransaction
Modifier and Type | Field and Description |
---|---|
protected Set<Object> |
affectedKeys |
protected Set<Object> |
backupKeyLocks |
protected Set<Object> |
lockedKeys |
protected HashMap<Object,CacheEntry> |
lookedUpEntries |
protected List<WriteCommand> |
modifications |
protected boolean |
prepared |
protected GlobalTransaction |
tx |
Constructor and Description |
---|
AbstractCacheTransaction(GlobalTransaction tx,
int viewId) |
Modifier and Type | Method and Description |
---|---|
void |
addAffectedKey(Object key) |
void |
addAllAffectedKeys(Collection<Object> keys) |
void |
addBackupLockForKey(Object key) |
void |
addReadKey(Object key) |
void |
clearLockedKeys() |
void |
clearLookedUpEntries() |
Set<Object> |
getAffectedKeys() |
GlobalTransaction |
getGlobalTransaction()
Returns the transaction identifier.
|
Set<Object> |
getLockedKeys() |
Map<Object,CacheEntry> |
getLookedUpEntries() |
List<WriteCommand> |
getModifications()
Returns the modifications visible within the current transaction.
|
EntryVersionsMap |
getUpdatedEntryVersions() |
int |
getViewId() |
boolean |
keyRead(Object key) |
CacheEntry |
lookupEntry(Object key) |
void |
notifyOnTransactionFinished() |
boolean |
ownsLock(Object key) |
void |
registerLockedKey(Object key) |
void |
removeLookedUpEntry(Object key) |
void |
setModifications(WriteCommand[] modifications) |
void |
setUpdatedEntryVersions(EntryVersionsMap updatedEntryVersions) |
boolean |
waitForLockRelease(Object key,
long lockAcquisitionTimeout) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
putLookedUpEntries, putLookedUpEntry
protected final GlobalTransaction tx
protected List<WriteCommand> modifications
protected HashMap<Object,CacheEntry> lookedUpEntries
protected volatile boolean prepared
public AbstractCacheTransaction(GlobalTransaction tx, int viewId)
public GlobalTransaction getGlobalTransaction()
CacheTransaction
getGlobalTransaction
in interface CacheTransaction
public List<WriteCommand> getModifications()
CacheTransaction
getModifications
in interface CacheTransaction
public void setModifications(WriteCommand[] modifications)
public Map<Object,CacheEntry> getLookedUpEntries()
getLookedUpEntries
in interface CacheTransaction
public CacheEntry lookupEntry(Object key)
lookupEntry
in interface CacheTransaction
public void removeLookedUpEntry(Object key)
removeLookedUpEntry
in interface CacheTransaction
public void clearLookedUpEntries()
clearLookedUpEntries
in interface CacheTransaction
public boolean ownsLock(Object key)
ownsLock
in interface CacheTransaction
public void notifyOnTransactionFinished()
notifyOnTransactionFinished
in interface CacheTransaction
AbstractTxLockingInterceptor.lockKeyAndCheckOwnership(org.infinispan.context.InvocationContext, Object)
public boolean waitForLockRelease(Object key, long lockAcquisitionTimeout) throws InterruptedException
waitForLockRelease
in interface CacheTransaction
InterruptedException
AbstractTxLockingInterceptor.lockKeyAndCheckOwnership(org.infinispan.context.InvocationContext, Object)
public int getViewId()
getViewId
in interface CacheTransaction
public void addBackupLockForKey(Object key)
addBackupLockForKey
in interface CacheTransaction
public void registerLockedKey(Object key)
public Set<Object> getLockedKeys()
getLockedKeys
in interface CacheTransaction
public void clearLockedKeys()
clearLockedKeys
in interface CacheTransaction
public void addAffectedKey(Object key)
public void addAllAffectedKeys(Collection<Object> keys)
public EntryVersionsMap getUpdatedEntryVersions()
getUpdatedEntryVersions
in interface CacheTransaction
public void setUpdatedEntryVersions(EntryVersionsMap updatedEntryVersions)
setUpdatedEntryVersions
in interface CacheTransaction
public void addReadKey(Object key)
addReadKey
in interface CacheTransaction
public boolean keyRead(Object key)
keyRead
in interface CacheTransaction
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.