public static class LazyLoadingPolicy.Builder
extends java.lang.Object
LazyLoadingPolicy instance.| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
LazyLoadingPolicy.Builder |
asyncRefresh(boolean asyncRefresh)
Sets whether the cache should refresh itself asynchronously or synchronously.
|
LazyLoadingPolicy |
build(ConfigFetcher configFetcher,
ConfigCache cache)
Builds the configured
LazyLoadingPolicy instance. |
LazyLoadingPolicy.Builder |
cacheRefreshIntervalInSeconds(int cacheRefreshIntervalInSeconds)
Sets how long the cache will store its value before fetching the
latest from the network again.
|
public LazyLoadingPolicy.Builder cacheRefreshIntervalInSeconds(int cacheRefreshIntervalInSeconds)
cacheRefreshIntervalInSeconds - the refresh interval value in seconds.public LazyLoadingPolicy.Builder asyncRefresh(boolean asyncRefresh)
If it's set to true reading from the policy will not wait for the refresh to be finished,
instead it returns immediately with the previous stored value.
If it's set to false the policy will wait until the expired
value is being refreshed with the latest configuration.
asyncRefresh - the refresh behavior.public LazyLoadingPolicy build(ConfigFetcher configFetcher, ConfigCache cache)
LazyLoadingPolicy instance.configFetcher - the internal config fetcher.cache - the internal cache.LazyLoadingPolicy instance