Class CachedSupplier.Builder<T>
java.lang.Object
software.amazon.awssdk.utils.cache.CachedSupplier.Builder<T>
- Enclosing class:
CachedSupplier<T>
A Builder for
CachedSupplier
, created by CachedSupplier.builder(Supplier)
.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Create aCachedSupplier
using the current configuration of this builder.cachedValueName
(String cachedValueName) Configures a name for the cached value.Configure the clock used for this cached supplier.prefetchStrategy
(CachedSupplier.PrefetchStrategy prefetchStrategy) Configure the way in which data in the cache should be pre-fetched when the data'sRefreshResult.prefetchTime()
arrives.staleValueBehavior
(CachedSupplier.StaleValueBehavior staleValueBehavior) Configure the way the cache should behave when a stale value is retrieved or when retrieving a value fails while the cache is stale.
-
Method Details
-
prefetchStrategy
Configure the way in which data in the cache should be pre-fetched when the data'sRefreshResult.prefetchTime()
arrives. By default, this uses theOneCallerBlocks
strategy, which will block a singleCachedSupplier.get()
caller to update the value. -
staleValueBehavior
public CachedSupplier.Builder<T> staleValueBehavior(CachedSupplier.StaleValueBehavior staleValueBehavior) Configure the way the cache should behave when a stale value is retrieved or when retrieving a value fails while the cache is stale. By default, this usesCachedSupplier.StaleValueBehavior.STRICT
. -
cachedValueName
Configures a name for the cached value. This name will be included with logs emitted by this supplier, to aid in debugging. By default, this uses "unknown". -
clock
Configure the clock used for this cached supplier. Configurable for testing. -
build
Create aCachedSupplier
using the current configuration of this builder.
-