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>, Serializable
- Enclosing class:
BoundedLocalCache<K,V>
static final class BoundedLocalCache.BoundedLocalAsyncLoadingCache<K,V>
extends LocalAsyncLoadingCache<K,V>
implements Serializable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final classNested classes/interfaces inherited from class LocalAsyncLoadingCache
LocalAsyncLoadingCache.LoadingCacheView<K,V> Nested classes/interfaces inherited from interface 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) final boolean(package private) @Nullable ConcurrentMap<K, CompletableFuture<V>> private static final longFields inherited from class LocalAsyncLoadingCache
cacheView, canBulkLoad, loader, logger -
Constructor Summary
ConstructorsConstructorDescriptionBoundedLocalAsyncLoadingCache(Caffeine<K, V> builder, AsyncCacheLoader<? super K, V> loader) -
Method Summary
Modifier and TypeMethodDescriptionasMap()Returns a view of the entries stored in this cache as a thread-safe map.cache()Returns the backingLocalCachedata store.policy()Returns the policy supported by this implementation and its configuration.private voidreadObject(ObjectInputStream stream) (package private) ObjectMethods inherited from class LocalAsyncLoadingCache
get, getAll, synchronousMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface 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 -
policy
-
-
Constructor Details
-
BoundedLocalAsyncLoadingCache
-
-
Method Details
-
cache
Description copied from interface:LocalAsyncCacheReturns the backingLocalCachedata store.- Specified by:
cachein interfaceLocalAsyncCache<K,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, BiFunction), 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
Description copied from interface:LocalAsyncCacheReturns the policy supported by this implementation and its configuration.- Specified by:
policyin interfaceLocalAsyncCache<K,V>
-
readObject
- Throws:
InvalidObjectException
-
writeReplace
Object writeReplace()
-