Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ConfigReader

Abstract config reader that supports configuration parameterization.

Configuration parameters

  • parameters: this entire section is used as template parameters

    • ...

    @see IConfigReader

Hierarchy

Implements

  • any

Index

Constructors

constructor

  • Creates a new instance of the config reader.

    Returns ConfigReader

Methods

addChangeListener

  • addChangeListener(listener: INotifiable): void
  • Adds a listener that will be notified when configuration is changed

    Parameters

    • listener: INotifiable

      a listener to be added.

    Returns void

configure

  • configure(config: ConfigParams): void
  • Configures component by passing configuration parameters.

    Parameters

    • config: ConfigParams

      configuration parameters to be set.

    Returns void

Protected parameterize

  • parameterize(config: string, parameters: ConfigParams): string
  • Parameterized configuration template given as string with dynamic parameters.

    The method uses Handlebars template engine.

    Parameters

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

Abstract readConfig

  • readConfig(correlationId: string, parameters: ConfigParams, callback: function): void
  • Reads configuration and parameterize it with given values.

    Parameters

    • correlationId: string

      (optional) transaction id to trace execution through call chain.

    • parameters: ConfigParams

      values to parameters the configuration or null to skip parameterization.

    • callback: function

      callback function that receives configuration or error.

        • (err: any, config: ConfigParams): void
        • Parameters

          • err: any
          • config: ConfigParams

          Returns void

    Returns void

removeChangeListener

  • removeChangeListener(listener: INotifiable): void
  • Remove a previously added change listener.

    Parameters

    • listener: INotifiable

      a listener to be removed.

    Returns void

Generated using TypeDoc