ConfigReader

Abstract config reader that supports configuration parameterization.

Inherits: 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

public virtual void AddChangeListener(INotifiable listener)

Configure

Configures component by passing configuration parameters.

public void Configure(ConfigParams config)

  • config: ConfigParams - configuration parameters to be set.

Parameterize

Parameterized configuration template given as string with dynamic parameters.

protected string Parameterize(string config, ConfigParams parameters)

  • config: string - a 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.

public virtual void RemoveChangeListener(INotifiable listener)

Abstract methods

ReadConfig

Reads configuration and parameterizes it with given values.

public abstract 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: ConfigParams - ConfigParams configuration.

See also