Interface IConfigReader

All Known Implementing Classes:
CachedConfigReader, ConfigReader, FileConfigReader, JsonConfigReader, MemoryConfigReader, YamlConfigReader

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

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

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addChangeListener(org.pipservices3.commons.run.INotifiable listener)
    Adds a listener that will be notified when configuration is changed
    org.pipservices3.commons.config.ConfigParams
    readConfig(String correlationId, org.pipservices3.commons.config.ConfigParams parameters)
    Reads configuration and parameterize it with given values.
    void
    removeChangeListener(org.pipservices3.commons.run.INotifiable listener)
    Remove a previously added change listener.
  • Method Details

    • readConfig

      org.pipservices3.commons.config.ConfigParams readConfig(String correlationId, org.pipservices3.commons.config.ConfigParams parameters) throws Exception
      Reads configuration and parameterize it with given values.
      Parameters:
      correlationId - (optional) transaction id to trace execution through call chain.
      parameters - values to parameters the configuration or null to skip parameterization.
      Returns:
      ConfigParams configuration.
      Throws:
      org.pipservices3.commons.errors.ApplicationException - when error occured.
      Exception
    • addChangeListener

      void addChangeListener(org.pipservices3.commons.run.INotifiable listener)
      Adds a listener that will be notified when configuration is changed
      Parameters:
      listener - a listener to be added.
    • removeChangeListener

      void removeChangeListener(org.pipservices3.commons.run.INotifiable listener)
      Remove a previously added change listener.
      Parameters:
      listener - a listener to be removed.