Interface AsyncClaimingCache<K,V>
- Type Parameters:
K
- The key typeV
- The value type
- All Known Implementing Classes:
AsyncClaimingCacheImplGuava
public interface AsyncClaimingCache<K,V>
Interface for an async cache that allows "claiming" entries.
Claiming means making explicit references to entries.
As long as an entry is claimed it will not be evicted.
Furthermore, eviction guards can be placed that prevent eviction even of
non-claimed entries.
-
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) Claim a key for which loading has already been triggered or which is already loaded.Return a snapshot of all present keysvoid
void
invalidateAll
(Iterable<? extends K> keys)
-
Method Details
-
claim
Claim a reference to the key's entry. -
claimIfPresent
Claim a key for which loading has already been triggered or which is already loaded. Calling this method should not trigger loading. -
addEvictionGuard
Protect eviction of certain keys as long as the guard is not disposed. Disposable may immediately evict all no longer guarded items -
getPresentKeys
Collection<K> getPresentKeys()Return a snapshot of all present keys -
invalidateAll
void invalidateAll() -
invalidateAll
-