Interface AsyncClaimingCache<K,V>
- Type Parameters:
K-V-
- All Known Implementing Classes:
AsyncClaimingCache3Impl, AsyncClaimingCacheImpl, AsyncClaimingCacheWithTransformValue
public interface AsyncClaimingCache<K,V>
Interface for an async cache that allows "claiming" (= making explicit references) to entries.
As long as an entry is claimed it will not be evicted.
- Author:
- raven
-
Method Summary
Modifier and TypeMethodDescriptionaddEvictionGuard(Predicate<? super K> predicate) Protect eviction of certain keys as long as the guard is not disposed.Claim a reference to the key's entry.claimIfPresent(K key) Cannot raise an ExecutionException because it does not trigger loadingvoid
-
Method Details
-
claim
Claim a reference to the key's entry.- Parameters:
key-- Returns:
- Throws:
ExecutionException
-
claimIfPresent
-
addEvictionGuard
Protect eviction of certain keys as long as the guard is not disposed. Disposable may immediately evict all no longer guarded items -
invalidateAll
void invalidateAll()
-