Class BoundedLocalCache.BoundedLocalAsyncLoadingCache<K,V>
- java.lang.Object
-
- com.github.benmanes.caffeine.cache.LocalAsyncLoadingCache<K,V>
-
- com.github.benmanes.caffeine.cache.BoundedLocalCache.BoundedLocalAsyncLoadingCache<K,V>
-
- All Implemented Interfaces:
AsyncCache<K,V>,AsyncLoadingCache<K,V>,LocalAsyncCache<K,V>,java.io.Serializable
- Enclosing class:
- BoundedLocalCache<K,V>
static final class BoundedLocalCache.BoundedLocalAsyncLoadingCache<K,V> extends LocalAsyncLoadingCache<K,V> implements java.io.Serializable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classBoundedLocalCache.BoundedLocalAsyncLoadingCache.AsyncLoader<K,V>-
Nested classes/interfaces inherited from class com.github.benmanes.caffeine.cache.LocalAsyncLoadingCache
LocalAsyncLoadingCache.LoadingCacheView<K,V>
-
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
Fields Modifier and Type Field Description (package private) BoundedLocalCache<K,java.util.concurrent.CompletableFuture<V>>cache(package private) booleanisWeighted(package private) @Nullable java.util.concurrent.ConcurrentMap<K,java.util.concurrent.CompletableFuture<V>>mapView(package private) @Nullable Policy<K,V>policyprivate static longserialVersionUID-
Fields inherited from class com.github.benmanes.caffeine.cache.LocalAsyncLoadingCache
cacheView, canBulkLoad, loader, logger
-
-
Constructor Summary
Constructors Constructor Description BoundedLocalAsyncLoadingCache(Caffeine<K,V> builder, AsyncCacheLoader<? super K,V> loader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.concurrent.ConcurrentMap<K,java.util.concurrent.CompletableFuture<V>>asMap()Returns a view of the entries stored in this cache as a thread-safe map.BoundedLocalCache<K,java.util.concurrent.CompletableFuture<V>>cache()Returns the backingLocalCachedata store.Policy<K,V>policy()Returns the policy supported by this implementation and its configuration.private voidreadObject(java.io.ObjectInputStream stream)(package private) java.lang.ObjectwriteReplace()-
Methods inherited from class com.github.benmanes.caffeine.cache.LocalAsyncLoadingCache
get, getAll, synchronous
-
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 Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
cache
final BoundedLocalCache<K,java.util.concurrent.CompletableFuture<V>> cache
-
isWeighted
final boolean isWeighted
-
mapView
@Nullable java.util.concurrent.ConcurrentMap<K,java.util.concurrent.CompletableFuture<V>> mapView
-
-
Method Detail
-
cache
public BoundedLocalCache<K,java.util.concurrent.CompletableFuture<V>> cache()
Description copied from interface:LocalAsyncCacheReturns the backingLocalCachedata store.- Specified by:
cachein interfaceLocalAsyncCache<K,V>
-
asMap
public java.util.concurrent.ConcurrentMap<K,java.util.concurrent.CompletableFuture<V>> asMap()
Description copied from interface:AsyncCacheReturns 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:
asMapin interfaceAsyncCache<K,V>- Specified by:
asMapin interfaceAsyncLoadingCache<K,V>- Returns:
- a thread-safe view of this cache supporting all of the optional
Mapoperations
-
policy
public Policy<K,V> policy()
Description copied from interface:LocalAsyncCacheReturns the policy supported by this implementation and its configuration.- Specified by:
policyin interfaceLocalAsyncCache<K,V>
-
readObject
private void readObject(java.io.ObjectInputStream stream) throws java.io.InvalidObjectException- Throws:
java.io.InvalidObjectException
-
writeReplace
java.lang.Object writeReplace()
-
-