public interface CacheTransaction
Modifier and Type | Interface and Description |
---|---|
static interface |
CacheTransaction.TransactionCompletedListener |
Modifier and Type | Method and Description |
---|---|
void |
addBackupLockForKey(Object key) |
void |
addListener(CacheTransaction.TransactionCompletedListener listener) |
void |
addReadKey(Object key) |
void |
addVersionRead(Object key,
EntryVersion version)
Sets the version read for this key.
|
boolean |
areLocksReleased()
Deprecated.
|
void |
cleanupBackupLocks()
It cleans up the backup locks for this transaction.
|
void |
clearLockedKeys() |
void |
clearLookedUpEntries() |
boolean |
containsLockOrBackupLock(Object key)
Deprecated.
|
Object |
findAnyLockedOrBackupLocked(Collection<Object> keys)
Deprecated.
|
void |
freezeModifications()
Prevent new modifications after prepare or commit started.
|
List<WriteCommand> |
getAllModifications()
Returns all the modifications visible within the current transaction, including those using Flag#CACHE_MODE_LOCAL.
|
Set<Object> |
getBackupLockedKeys() |
long |
getCreationTime() |
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.
|
CompletableFuture<Void> |
getReleaseFutureForKey(Object key)
It returns a
CompletableFuture that completes when the lock for the key is released. |
KeyValuePair<Object,CompletableFuture<Void>> |
getReleaseFutureForKeys(Collection<Object> keys)
Same as
getReleaseFutureForKey(Object) but it returns a pair with the key and the future. |
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(long lockAcquisitionTimeout)
Deprecated.
|
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()
@Deprecated boolean waitForLockRelease(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.@Deprecated boolean containsLockOrBackupLock(Object key)
@Deprecated Object findAnyLockedOrBackupLocked(Collection<Object> keys)
@Deprecated boolean areLocksReleased()
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()
long getCreationTime()
void addListener(CacheTransaction.TransactionCompletedListener listener)
void freezeModifications()
CompletableFuture<Void> getReleaseFutureForKey(Object key)
CompletableFuture
that completes when the lock for the key
is released.
If the key
is not locked by this transaction, it returns null
.key
- the key.CompletableFuture
or null
if the key is not locked by this transaction.KeyValuePair<Object,CompletableFuture<Void>> getReleaseFutureForKeys(Collection<Object> keys)
getReleaseFutureForKey(Object)
but it returns a pair with the key and the future.void cleanupBackupLocks()
Copyright © 2016 JBoss, a division of Red Hat. All rights reserved.