public static class AutoPollingPolicy.Builder
extends java.lang.Object
AutoPollingPolicy instance.| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
AutoPollingPolicy.Builder |
autoPollIntervalInSeconds(int autoPollIntervalInSeconds)
Sets at least how often this policy should fetch the latest configuration and refresh the cache.
|
AutoPollingPolicy |
build(ConfigFetcher configFetcher,
ConfigCache cache)
Builds the configured
AutoPollingPolicy instance. |
AutoPollingPolicy.Builder |
configurationChangeListener(ConfigurationChangeListener listener)
Sets a configuration changed listener.
|
public AutoPollingPolicy.Builder autoPollIntervalInSeconds(int autoPollIntervalInSeconds)
autoPollIntervalInSeconds - the poll interval in seconds.java.lang.IllegalArgumentException - when the given value is less than 2 seconds.public AutoPollingPolicy.Builder configurationChangeListener(ConfigurationChangeListener listener)
listener - the listener.java.lang.IllegalArgumentException - when the given listener is null.public AutoPollingPolicy build(ConfigFetcher configFetcher, ConfigCache cache)
AutoPollingPolicy instance.configFetcher - the internal config fetcher.cache - the internal cache.AutoPollingPolicy instance