public interface CacheTransaction
Modifier and Type | Method and Description |
---|---|
void |
addBackupLockForKey(Object key) |
void |
addReadKey(Object key) |
void |
addVersionRead(Object key,
EntryVersion version)
Sets the version read for this key.
|
void |
clearLockedKeys() |
void |
clearLookedUpEntries() |
List<WriteCommand> |
getAllModifications()
Returns all the modifications visible within the current transaction, including those using Flag#CACHE_MODE_LOCAL.
|
Set<Object> |
getBackupLockedKeys() |
GlobalTransaction |
getGlobalTransaction()
Returns the transaction identifier.
|
Set<Object> |
getLockedKeys() |
Map<Object,CacheEntry> |
getLookedUpEntries() |
EntryVersion |
getLookedUpRemoteVersion(Object key) |
List<WriteCommand> |
getModifications()
Returns the modifications visible within the current transaction.
|
int |
getTopologyId() |
EntryVersionsMap |
getUpdatedEntryVersions() |
EntryVersionsMap |
getVersionsRead()
Note: used in Repeatable Read + Write Skew + Clustering + Versioning.
|
boolean |
hasModification(Class<?> modificationClass)
Checks if a modification of the given class (or subclass) is present in this transaction.
|
boolean |
isMarkedForRollback() |
boolean |
keyRead(Object key) |
CacheEntry |
lookupEntry(Object key) |
void |
markForRollback(boolean markForRollback) |
void |
notifyOnTransactionFinished() |
boolean |
ownsLock(Object key) |
void |
putLookedUpEntries(Map<Object,CacheEntry> entries) |
void |
putLookedUpEntry(Object key,
CacheEntry e) |
void |
putLookedUpRemoteVersion(Object key,
EntryVersion version) |
void |
removeLookedUpEntry(Object key) |
void |
replaceVersionRead(Object key,
EntryVersion version)
Sets the version read fr this key, replacing the old version if it exists, i.e each invocation updates the version
of the key.
|
void |
setUpdatedEntryVersions(EntryVersionsMap updatedEntryVersions) |
boolean |
waitForLockRelease(Object key,
long lockAcquisitionTimeout)
Checks if this transaction holds a lock on the given key and then waits until the transaction completes or until
the timeout expires and returns
true if the transaction is complete or false otherwise. |
GlobalTransaction getGlobalTransaction()
List<WriteCommand> getModifications()
List<WriteCommand> getAllModifications()
boolean hasModification(Class<?> modificationClass)
modificationClass
- the modification type to look forCacheEntry lookupEntry(Object key)
Map<Object,CacheEntry> getLookedUpEntries()
void putLookedUpEntry(Object key, CacheEntry e)
void putLookedUpEntries(Map<Object,CacheEntry> entries)
void removeLookedUpEntry(Object key)
void clearLookedUpEntries()
boolean ownsLock(Object key)
void clearLockedKeys()
int getTopologyId()
void addBackupLockForKey(Object key)
void notifyOnTransactionFinished()
org.infinispan.interceptors.locking.AbstractTxLockingInterceptor#lockKeyAndCheckOwnership(org.infinispan.context.InvocationContext, Object)
boolean waitForLockRelease(Object key, long lockAcquisitionTimeout) throws InterruptedException
true
if the transaction is complete or false
otherwise.
If the key is not locked or if the transaction is already completed it returns true
immediately.
This method is subject to spurious returns in a way similar to Object.wait()
. It can sometimes return
before the specified time has elapsed and without guaranteeing that this transaction is complete. The caller is
responsible to call the method again if transaction completion was not reached and the time budget was not spent.InterruptedException
org.infinispan.interceptors.locking.AbstractTxLockingInterceptor#lockKeyAndCheckOwnership(org.infinispan.context.InvocationContext, Object)
EntryVersionsMap getUpdatedEntryVersions()
void setUpdatedEntryVersions(EntryVersionsMap updatedEntryVersions)
void putLookedUpRemoteVersion(Object key, EntryVersion version)
EntryVersion getLookedUpRemoteVersion(Object key)
boolean keyRead(Object key)
void addReadKey(Object key)
boolean isMarkedForRollback()
void markForRollback(boolean markForRollback)
void addVersionRead(Object key, EntryVersion version)
void replaceVersionRead(Object key, EntryVersion version)
EntryVersionsMap getVersionsRead()
Copyright © 2014 JBoss, a division of Red Hat. All Rights Reserved.