pip_services3_components.config.MemoryConfigReader module
pip_services3_components.config.MemoryConfigReader
Memory config reader implementation
- copyright
Conceptual Vision Consulting LLC 2018-2019, see AUTHORS for more details.
- license
MIT, see LICENSE for more details.
-
class
pip_services3_components.config.MemoryConfigReader.
MemoryConfigReader
(config: pip_services3_commons.config.ConfigParams.ConfigParams = None) Bases:
pip_services3_components.config.IConfigReader.IConfigReader
,pip_services3_commons.config.IReconfigurable.IReconfigurable
Config reader that stores configuration in memory.
### Configuration parameters ###
The configuration parameters are the configuration template
Example:
config = ConfigParams.from_tuples( "connection.host", "localhost", "connection.port", "8080" ) configReader = MemoryConfigReader() configReader.configure(config) parameters = ConfigParams.fromValue(os.get_env()) configReader.read_config_("123", parameters)
-
add_change_listener
(listener: pip_services3_commons.run.INotifiable.INotifiable) Adds a listener that will be notified when configuration is changed
- Parameters
listener – a listener to be added.
-
configure
(config: pip_services3_commons.config.ConfigParams.ConfigParams) Configures component by passing configuration parameters.
- Parameters
config – configuration parameters to be set.
-
read_config_
(correlation_id: Optional[str], parameters: pip_services3_commons.config.ConfigParams.ConfigParams) → pip_services3_commons.config.ConfigParams.ConfigParams Reads configuration and parameterize it with given values.
- Parameters
correlation_id – (optional) transaction id to trace execution through call chain.
parameters – values to parameters the configuration or null to skip parameterization.
- Returns
ConfigParams configuration.
-
remove_change_listener
(listener: pip_services3_commons.run.INotifiable.INotifiable) Remove a previously added change listener.
- Parameters
listener – a listener to be removed.
-