Class CompositeConfigurationSource

java.lang.Object
io.inverno.mod.configuration.source.CompositeConfigurationSource
All Implemented Interfaces:
ConfigurationSource<CompositeConfigurationSource.CompositeConfigurationQuery,CompositeConfigurationSource.CompositeExecutableConfigurationQuery,CompositeConfigurationSource.CompositeListConfigurationQuery>
Direct Known Subclasses:
BootstrapConfigurationSource

A composite configuration source that uses multiple configuration sources to resolve configuration properties.

A composite configuration source uses a CompositeConfigurationStrategy to determine the best matching value among the different sources for a given query.

A composite configuration source queries its sources in sequence. It first applies a new CompositeConfigurationStrategy.CompositeDefaultingStrategy provided by CompositeConfigurationStrategy.createDefaultingStrategy() to the sources that implement DefaultableConfigurationSource. This allows to specify a defaulting strategy when executing queries on each sources. The composite defaulting strategy allows to reduce the queries to execute on each source by keeping track of intermediate results in each round.

Configuration sources are ordered from the highest to lowest priority, the strategy allows to specify whether a result returned by a source for a given query supersedes the result returned in a previous round for the same query (see CompositeConfigurationStrategy.isSuperseded(io.inverno.mod.configuration.ConfigurationKey, io.inverno.mod.configuration.ConfigurationKey, io.inverno.mod.configuration.ConfigurationKey)).

At the end of each round, the strategy is used to determine whether a result resolves a query (see CompositeConfigurationStrategy.isResolved(io.inverno.mod.configuration.ConfigurationKey, io.inverno.mod.configuration.ConfigurationKey)), in which case the query is removed from the list of queries to execute on subsequent sources.

Since:
1.0
Author:
Jeremy Kuhn
See Also: