Implements: IConfigurable, IConfigReader
Description
The ConfigReader class allows you to create config readers that support configuration parameterization.
Configuration parameters
- parameters: this entire section is used as template parameters
- …
Instance methods
addChangeListener
Adds a listener that will be notified when configuration is changed
publicvoid addChangeListener(INotifiable listener)
- listener: INotifiable - a listener to be added.
configure
Configures component by passing configuration parameters.
publicvoid configure(ConfigParams config)
- config: ConfigParams - configuration parameters to be set.
parameterize
Parameterized configuration template given as string with dynamic parameters.
protected staticString parameterize(String config, ConfigParams parameters) throws Exception
- config: String - a string with configuration template to be parameterized
- parameters: ConfigParams - dynamic parameters to inject into the template
- returns: String - a parameterized configuration string.
removeChangeListener
Remove a previously added change listener.
publicvoid removeChangeListener(INotifiable listener)
- listener: INotifiable - a listener to be removed.
Abstract methods
readConfig
Reads configuration and parameterizes it with given values.
public abstractConfigParams readConfig(IContext context, ConfigParams parameters) throws ApplicationException
- context: IContext - (optional) a context to trace execution through a call chain.
- parameters: ConfigParams - values to parameters of the configuration or null to skip parameterization.
- returns: ConfigParams - ConfigParams configuration.