public final class PollingModes
extends java.lang.Object
| Constructor and Description |
|---|
PollingModes() |
| Modifier and Type | Method and Description |
|---|---|
static PollingMode |
AutoPoll(int autoPollIntervalInSeconds)
Creates a configured auto polling configuration.
|
static PollingMode |
AutoPoll(int autoPollIntervalInSeconds,
ConfigurationChangeListener listener)
Creates a configured auto polling configuration.
|
static PollingMode |
LazyLoad(int cacheRefreshIntervalInSeconds)
Creates a configured lazy loading polling configuration.
|
static PollingMode |
LazyLoad(int cacheRefreshIntervalInSeconds,
boolean asyncRefresh)
Creates a configured lazy loading polling configuration.
|
static PollingMode |
ManualPoll()
Creates a configured manual polling configuration.
|
public static PollingMode AutoPoll(int autoPollIntervalInSeconds)
autoPollIntervalInSeconds - Sets at least how often this policy should fetch the latest configuration and refresh the cache.public static PollingMode AutoPoll(int autoPollIntervalInSeconds, ConfigurationChangeListener listener)
autoPollIntervalInSeconds - Sets at least how often this policy should fetch the latest configuration and refresh the cache.listener - Sets a configuration changed listener.public static PollingMode LazyLoad(int cacheRefreshIntervalInSeconds)
cacheRefreshIntervalInSeconds - Sets how long the cache will store its value before fetching the latest from the network again.public static PollingMode LazyLoad(int cacheRefreshIntervalInSeconds, boolean asyncRefresh)
cacheRefreshIntervalInSeconds - Sets how long the cache will store its value before fetching the latest from the network again.asyncRefresh - Sets whether the cache should refresh itself asynchronously or synchronously.
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.
public static PollingMode ManualPoll()