Package org.alfresco.repo.cache
Interface LockingCache<K extends Serializable,V>
- All Superinterfaces:
SimpleCache<K,
V>
Interface for caches that support value locking
- Since:
- 4.1.6
- Author:
- Derek Hulley
-
Method Summary
Modifier and TypeMethodDescriptionboolean
isValueLocked
(K key) Determine if a value (addition, removal or update) has been locked for the remainer of the transactionvoid
Prevent a key's value from being changed for the duriation of the transaction.void
unlockValue
(K key) Cancel any previous lock applied to a key's value.
-
Method Details
-
isValueLocked
Determine if a value (addition, removal or update) has been locked for the remainer of the transaction- Parameters:
key
- the cache key to check up on- Returns:
- true if the value will not change for the remaineder of the transaction
-
lockValue
Prevent a key's value from being changed for the duriation of the transaction. By default, further attempts to modify the associated value will be ignored; this includes add a value back after removal.- Parameters:
key
- the cache key that will be locked against change
-
unlockValue
Cancel any previous lock applied to a key's value.- Parameters:
key
- the cache key that will be unlocked, allowing changes
-