- All Known Implementing Classes:
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
tree, as accessed through
Once it loads a
Config tree from
ConfigSources the config
system does not itself change the in-memory
Config tree. Even so, the
underlying data available via the tree's
ConfigSources can change.
The Config system nevertheless supports change notification through
Config.onChange(java.util.function.Consumer) and that is enabled
also by polling strategies.
In implementations of
PollingStrategy provide a notification mechanism
start(io.helidon.config.spi.PollingStrategy.Polled), where the
polled component receives events that should check for changes.
In config system itself, this is handled by internals and is not exposed outside
A config source implements appropriate functionality in method
PollableSource.isModified(Object), which will
be invoked each time a polling strategy triggers the listener.
As described with
MetaConfig.configSource(io.helidon.config.Config), the config system can
ConfigSources using meta-configuration, which supports
specifying polling strategies. All
strategies and custom ones are supported.
PollingStrategyProvider for details.
The meta-configuration for a config source can set the property
polling-strategy using the following nested
type- name of the polling strategy implementation (referencing the Java Service Loader service)
Built-in Polling Strategies Name Strategy Required Properties
Scheduled polling at regular intervals. See
PT15Smeans 15 seconds
class- fully-qualified class name of a custom polling strategy implementation or a builder class that implements a
build()method that returns a
indicate a polling strategy but not both. If both appear the config system
Meta-configuration Support for Custom Polling StrategiesTo support settings in meta-configuration, a custom polling strategy must be capable of processing the meta configuration provided to
Nested Class SummaryModifier and TypeInterfaceDescription
static interfaceA polled component.
(PollingStrategy.Polled polled)Start this polling strategy. From this point in time, the polled will receive events on
PollingStrategy.Polled.poll(java.time.Instant). It is the responsibility of the
PollingStrategy.Polledto handle such requests. A
ConfigSourceneeds only support for polling stamps to support a polling strategy, the actual reloading is handled by the configuration component. There is no need to implement
PollingStrategy.Polledyourself, unless you want to implement a new component that supports polling. Possible reloads of configuration are happening within the thread that invokes this method.
polled- a component receiving polling events.
stopdefault void stop()Stop polling and release all resources.