Abstract config reader that supports configuration parameterization.

Implements: IConfigurable, IConfigReader


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


Adds a listener that will be notified when configuration is changed

public addChangeListener(listener: INotifiable): void


Configures component by passing configuration parameters.

public configure(config: ConfigParams): void

  • config: ConfigParams - configuration parameters to be set.


Parameterized configuration template given as string with dynamic parameters.

protected parameterize(config: string, parameters: ConfigParams): string

  • 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.


Remove a previously added change listener.

public removeChangeListener(listener: INotifiable): void

Abstract methods


Reads configuration and parameterizes it with given values.

public abstract readConfig(correlationId: string, parameters: ConfigParams) Promise<ConfigParams>

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

See also