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 |
addVersionRead(Object key,
EntryVersion version)
Sets the version read for this key.
|
void |
cleanupBackupLocks()
It cleans up the backup locks for this transaction.
|
void |
clearLockedKeys() |
void |
clearLookedUpEntries() |
void |
forEachBackupLock(Consumer<Object> consumer)
Invokes the
Consumer with each backup lock. |
void |
forEachLock(Consumer<Object> consumer)
Invokes the
Consumer with each lock. |
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.
|
long |
getCreationTime() |
GlobalTransaction |
getGlobalTransaction()
Returns the transaction identifier.
|
Set<Object> |
getLockedKeys() |
Map<Object,CacheEntry> |
getLookedUpEntries() |
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. |
Map<Object,CompletableFuture<Void>> |
getReleaseFutureForKeys(Collection<Object> keys)
Same as
getReleaseFutureForKey(Object) but it returns a pair with the key and the future. |
int |
getTopologyId() |
Map<Object,IncrementableEntryVersion> |
getUpdatedEntryVersions() |
Map<Object,IncrementableEntryVersion> |
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() |
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 |
removeBackupLock(Object key)
It cleans up the backup for
key . |
void |
removeBackupLocks(Collection<?> keys)
It cleans up the backup lock for the
keys . |
void |
removeLookedUpEntry(Object key) |
void |
setUpdatedEntryVersions(Map<Object,IncrementableEntryVersion> updatedEntryVersions) |
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()
Map<Object,IncrementableEntryVersion> getUpdatedEntryVersions()
void setUpdatedEntryVersions(Map<Object,IncrementableEntryVersion> updatedEntryVersions)
boolean isMarkedForRollback()
void markForRollback(boolean markForRollback)
void addVersionRead(Object key, EntryVersion version)
Map<Object,IncrementableEntryVersion> 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.Map<Object,CompletableFuture<Void>> getReleaseFutureForKeys(Collection<Object> keys)
getReleaseFutureForKey(Object)
but it returns a pair with the key and the future.void cleanupBackupLocks()
void removeBackupLocks(Collection<?> keys)
keys
.keys
- The keys to clean up the backup lock.void removeBackupLock(Object key)
key
.key
- The key to clean up the backup lock.void forEachLock(Consumer<Object> consumer)
Consumer
with each lock.consumer
- The backup lock Consumer
Copyright © 2021 JBoss by Red Hat. All rights reserved.