ConfigReader

Abstract config reader that supports configuration parameterization.

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

@override

void addChangeListener(INotifiable listener)

configure

Configures component by passing configuration parameters.

@override

void configure(ConfigParams config)

  • config: ConfigParams - configuration parameters to be set.

parameterize

Parameterized configuration template given as string with dynamic parameters.

String? parameterize(String config, ConfigParams parameters)

  • config: String - string with configuration template to be parameterized
  • parameters: ConfigParams - dynamic parameters to inject into the template
  • returns: String? - parameterized configuration string.

removeChangeListener

Remove a previously added change listener.

@override

void removeChangeListener(INotifiable listener)

readConfig

Reads configuration and parameterizes it with given values.

@override

Future<ConfigParams> readConfig(String? correlationId, ConfigParams parameters)

  • correlationId: String? - (optional) transaction id used to trace execution through the call chain.
  • parameters: ConfigParams - values to parameters of the configuration or null to skip parameterization.
  • returns: Future<ConfigParams> - ConfigParams configuration.

See also