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

add_change_listener

Adds a listener that will be notified when configuration is changed

add_change_listener(listener: INotifiable)

configure

Configures component by passing configuration parameters.

configure(config: ConfigParams)

  • config: ConfigParams - configuration parameters to be set.

_parameterize

Parameterized configuration template given as string with dynamic parameters.

_parameterize(config: str, parameters: ConfigParams): str

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

remove_change_listener

Remove a previously added change listener.

remove_change_listener(listener: INotifiable): void

Abstract methods

read_config_

Reads configuration and parameterizes it with given values.

abstractmethod read_config_(correlation_id: Optional[str], parameters: ConfigParams): ConfigParams

  • correlation_id: Optional[str] - (optional) transaction id to trace execution through call chain.
  • parameters: ConfigParams - values to parameters of the configuration or None to skip parameterization.
  • returns: ConfigParams - ConfigParams configuration.

See also