Class ConfigurationLoaderSupport<A,B,C extends ConfigurationLoaderSupport<A,B,C>>
- Type Parameters:
A
- the configuration typeB
- the configurator typeC
- the configuration loader type
- All Implemented Interfaces:
ConfigurationLoader<A,
C>
- Direct Known Subclasses:
BootConfigurationLoader
,BootNetClientConfigurationLoader
,BootNetServerConfigurationLoader
,GrpcBaseConfigurationLoader
,GrpcClientConfigurationLoader
,GrpcServerConfigurationLoader
,HttpClientConfigurationLoader
,HttpServerConfigurationLoader
,JOSEConfigurationLoader
,LDAPClientConfigurationLoader
,LettuceRedisClientConfigurationLoader
,VertxSqlClientConfigurationLoader
,WebServerConfigurationLoader
Base implementation for generated configuration loader.
ConfigurationLoaderSupport
implementations are generated by the Inverno configuration compiler and loads configuration properties explicitly invoking generated configurator and builder to
eventually load the configuration.
This configuration loader works as follows:
If a configuration source is specified:
- Loads a list of properties from the configuration source
- Maps the resulting query results to a configurer whose role is to inject the appropriate property values in a configurator specific to the configuration to load
- Invokes a configuration creator which uses the previous configurator to create the configuration
If no configuration is specified, fallback to a default configuration supplier to create the configuration.
- Since:
- 1.0
- Author:
- Jeremy Kuhn
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
ConfigurationLoaderSupport.ConfigurationBeanSupport<A,
B, C extends ConfigurationLoaderSupport<A, B, C>> Base implementation to generate configuration loader beans. -
Field Summary
Fields inherited from class io.inverno.mod.configuration.AbstractConfigurationLoader
parameters, source
-
Constructor Summary
ConstructorDescriptionConfigurationLoaderSupport
(String[] properties, Function<List<? extends ConfigurationQueryResult>, Consumer<B>> resultsToConfigurer, Function<Consumer<B>, A> configurationCreator, Supplier<A> defaultConfigurationSupplier) Creates a configuration loader that loads the specified list of properties and uses the specified results to configurer mapper and configuration creator function to create the configuration object. -
Method Summary
Methods inherited from class io.inverno.mod.configuration.AbstractConfigurationLoader
withParameters, withSource
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.inverno.mod.configuration.ConfigurationLoader
withParameters, withParameters, withParameters, withParameters, withParameters, withParameters, withParameters, withParameters, withParameters, withParameters, withParameters
-
Constructor Details
-
ConfigurationLoaderSupport
public ConfigurationLoaderSupport(String[] properties, Function<List<? extends ConfigurationQueryResult>, Consumer<B>> resultsToConfigurer, Function<Consumer<B>, A> configurationCreator, Supplier<A> defaultConfigurationSupplier) Creates a configuration loader that loads the specified list of properties and uses the specified results to configurer mapper and configuration creator function to create the configuration object.
- Parameters:
properties
- a list of property names to loadresultsToConfigurer
- a mapper function that maps the configuration query results to a configurerconfigurationCreator
- a configuration creatordefaultConfigurationSupplier
- a default configuration supplier
-
-
Method Details
-
withConfigurer
Sets a configurer that will override the configurer supplied when creating the loader when loading the configuration.
- Parameters:
configurer
- a configurer- Returns:
- the configuration loader
-
load
Description copied from interface:ConfigurationLoader
Loads the configuration from the configuration source with the specified parameters.
- Returns:
- a mono emitting the resulting configuration object
-