Class BoundedLocalCache.BoundedLocalAsyncCache<K,V>
java.lang.Object
com.github.benmanes.caffeine.cache.BoundedLocalCache.BoundedLocalAsyncCache<K,V>
- All Implemented Interfaces:
AsyncCache<K,
,V> LocalAsyncCache<K,
,V> Serializable
- Enclosing class:
BoundedLocalCache<K,
V>
static final class BoundedLocalCache.BoundedLocalAsyncCache<K,V>
extends Object
implements LocalAsyncCache<K,V>, Serializable
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.github.benmanes.caffeine.cache.LocalAsyncCache
LocalAsyncCache.AbstractCacheView<K,
V>, LocalAsyncCache.AsMapView<K, V>, LocalAsyncCache.AsyncAsMapView<K, V>, LocalAsyncCache.AsyncBulkCompleter<K, V>, LocalAsyncCache.CacheView<K, V> -
Field Summary
FieldsModifier and TypeFieldDescription(package private) final BoundedLocalCache
<K, CompletableFuture<V>> (package private) @Nullable LocalAsyncCache.CacheView
<K, V> (package private) final boolean
(package private) @Nullable ConcurrentMap
<K, CompletableFuture<V>> private static final long
Fields inherited from interface com.github.benmanes.caffeine.cache.LocalAsyncCache
logger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionasMap()
Returns a view of the entries stored in this cache as a thread-safe map.cache()
Returns the backingLocalCache
data store.policy()
Returns the policy supported by this implementation and its configuration.private void
readObject
(ObjectInputStream stream) Returns a view of the entries stored in this cache as a synchronousCache
.(package private) Object
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.github.benmanes.caffeine.cache.LocalAsyncCache
composeResult, get, get, get, getAll, getAll, getIfPresent, handleCompletion, put
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
cache
-
isWeighted
final boolean isWeighted -
mapView
@Nullable ConcurrentMap<K,CompletableFuture<V>> mapView -
cacheView
@Nullable LocalAsyncCache.CacheView<K,V> cacheView -
policy
-
-
Constructor Details
-
BoundedLocalAsyncCache
-
-
Method Details
-
cache
Description copied from interface:LocalAsyncCache
Returns the backingLocalCache
data store.- Specified by:
cache
in interfaceLocalAsyncCache<K,
V>
-
asMap
Description copied from interface:AsyncCache
Returns a view of the entries stored in this cache as a thread-safe map. Modifications made to the map directly affect the cache.A computation operation, such as
ConcurrentMap.compute(K, java.util.function.BiFunction<? super K, ? super V, ? extends V>)
, performs the entire method invocation atomically, so the function is applied at most once per key. Some attempted update operations by other threads may be blocked while computation is in progress. The computation must not attempt to update any other mappings of this cache.Iterators from the returned map are at least weakly consistent: they are safe for concurrent use, but if the cache is modified (including by eviction) after the iterator is created, it is undefined which of the changes (if any) will be reflected in that iterator.
- Specified by:
asMap
in interfaceAsyncCache<K,
V> - Returns:
- a thread-safe view of this cache supporting all of the optional
Map
operations
-
synchronous
Description copied from interface:AsyncCache
Returns a view of the entries stored in this cache as a synchronousCache
. A mapping is not present if the value is currently being loaded. Modifications made to the synchronous cache directly affect the asynchronous cache. If a modification is made to a mapping that is currently loading, the operation blocks until the computation completes.- Specified by:
synchronous
in interfaceAsyncCache<K,
V> - Returns:
- a thread-safe synchronous view of this cache
-
policy
Description copied from interface:LocalAsyncCache
Returns the policy supported by this implementation and its configuration.- Specified by:
policy
in interfaceLocalAsyncCache<K,
V>
-
readObject
- Throws:
InvalidObjectException
-
writeReplace
Object writeReplace()
-