IConfigReader

Interface for configuration readers that retrieve a configuration from various sources and make it available for other components.

Description

The IConfigReader interface is used in configuration readers that retrieve a configuration from various sources and make it availale for other components.

Important points

  • Some IConfigReader implementations may support configuration parameterization.
  • The parameterization allows you to use a configuration as a template and inject there dynamic values. The values may come from application command like arguments or environment variables.

Instance methods

AddChangeListener

Adds a listener that will be notified when configuration is changed

void AddChangeListener(INotifiable listener)

RemoveChangeListener

Remove a previously added change listener.

void RemoveChangeListener(INotifiable listener)

ReadConfig

Reads a configuration and parameterizes it with given values.

public ConfigParams ReadConfig(string correlationId, ConfigParams parameters)

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