AsyncLoadingCache interface to
minimize the effort required to implement a LocalCache.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final @Nullable BiFunction | |
| pack-priv final AsyncCacheLoader | |
| pack-priv @Nullable LocalAsyncLoadingCache. | |
| pack-priv static final System. | |
| pack-priv final BiFunction |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv boolean | canBulkLoad(AsyncCacheLoader<?, ?> loader)
Returns whether the supplied cache loader has bulk load functionality. |
| public CompletableFuture | get(K
the key with which the specified value is to be associated key)Implements com. key in this cache, obtaining that value from
AsyncCacheLoader#asyncLoad if necessary.
|
| public CompletableFuture | getAll(Iterable<? extends K>
the keys whose associated values are to be returned keys)Implements com. keys, creating or retrieving
those values if necessary.
|
| pack-priv @Nullable BiFunction | newBulkMappingFunction(AsyncCacheLoader<? super K, V> cacheLoader)
Returns a mapping function that adapts to |
| pack-priv BiFunction | newMappingFunction(AsyncCacheLoader<? super K, V> cacheLoader)
Returns a mapping function that adapts to |
| public LoadingCache | synchronous()
Implements com. LoadingCache.
|
| bulkMappingFunction | back to summary |
|---|---|
| pack-priv final @Nullable BiFunction<? super Set<? extends K>, ? super Executor, ? extends CompletableFuture<? extends Map<? extends K, ? extends V>>> bulkMappingFunction | |
| cacheLoader | back to summary |
|---|---|
| pack-priv final AsyncCacheLoader<K, V> cacheLoader | |
| cacheView | back to summary |
|---|---|
| pack-priv @Nullable LocalAsyncLoadingCache. | |
| logger | back to summary |
|---|---|
| pack-priv static final System. Hides com. | |
| mappingFunction | back to summary |
|---|---|
| pack-priv final BiFunction<? super K, ? super Executor, ? extends CompletableFuture<? extends V>> mappingFunction | |
| LocalAsyncLoadingCache | back to summary |
|---|---|
pack-priv LocalAsyncLoadingCache(AsyncCacheLoader<? super K, V> cacheLoader)
| |
| canBulkLoad | back to summary |
|---|---|
| pack-priv boolean canBulkLoad(AsyncCacheLoader<?, ?> loader) Returns whether the supplied cache loader has bulk load functionality. | |
| get | back to summary |
|---|---|
| public CompletableFuture Implements com. Doc from com. Returns the future associated with the
If the specified key is not already associated with a value, attempts to compute its value
asynchronously and enters it into this cache unless
| |
| getAll | back to summary |
|---|---|
| public CompletableFuture Implements com. Doc from com. Returns the future of a map of the values associated with
Caches loaded by a
Note that duplicate elements in
| |
| newBulkMappingFunction | back to summary |
|---|---|
| pack-priv @Nullable BiFunction Returns a mapping function that adapts to | |
| newMappingFunction | back to summary |
|---|---|
| pack-priv BiFunction Returns a mapping function that adapts to | |
| synchronous | back to summary |
|---|---|
| public LoadingCache Implements com. Doc from com. Returns a view of the entries stored in this cache as a synchronous
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final LocalAsyncLoadingCache | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv LocalAsyncLoadingCache | asyncCache()
Implements abstract com. |
| public V | get(K
the key with which the specified value is to be associated key)Implements com. key in this cache, obtaining that value from
CacheLoader#load(Object) if necessary.
|
| public Map | getAll(Iterable<? extends K>
the keys whose associated values are to be returned keys)Implements com. keys, creating or retrieving those
values if necessary.
|
| public CompletableFuture | refresh(K
key with which a value may be associated key)Implements com. key, asynchronously.
|
| public CompletableFuture | refreshAll(Iterable<? extends K>
the keys whose associated values are to be returned keys)Implements com. key, asynchronously.
|
| private @Nullable CompletableFuture | tryComputeRefresh(K key, Object keyReference)
Begins a refresh if the entry has materialized and no reload is in-flight. |
| private @Nullable CompletableFuture | tryOptimisticRefresh(K key, Object keyReference)
Attempts to avoid a reload if the entry is absent, or a load or reload is in-flight. |
| asyncCache | back to summary |
|---|---|
pack-priv final LocalAsyncLoadingCache<K, V> asyncCache
| |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides com. | |
| LoadingCacheView | back to summary |
|---|---|
| pack-priv LoadingCacheView(LocalAsyncLoadingCache<K, V> asyncCache) | |
| asyncCache | back to summary |
|---|---|
| pack-priv LocalAsyncLoadingCache Implements abstract com.
| |
| get | back to summary |
|---|---|
| public V get(K key) Implements com. Doc from com. Returns the value associated with the
If another call to
If the specified key is not already associated with a value, attempts to compute its value and
enters it into this cache unless
| |
| getAll | back to summary |
|---|---|
| public Map Implements com. Doc from com. Returns a map of the values associated with the
Caches loaded by a
Note that duplicate elements in
| |
| refresh | back to summary |
|---|---|
| public CompletableFuture Implements com. Doc from com. Loads a new value for the
Caches loaded by a
Returns an existing future without doing anything if another thread is currently loading the
value for
| |
| refreshAll | back to summary |
|---|---|
| public CompletableFuture Implements com. Doc from com. Loads a new value for each
Caches loaded by a
| |
| tryComputeRefresh | back to summary |
|---|---|
| private @Nullable CompletableFuture Begins a refresh if the entry has materialized and no reload is in-flight.
| |
| tryOptimisticRefresh | back to summary |
|---|---|
| private @Nullable CompletableFuture Attempts to avoid a reload if the entry is absent, or a load or reload is in-flight.
| |