public class ConfigRegistry extends Object
Modifier and Type | Method and Description |
---|---|
String |
getGlobalConfigValue(String configKey)
Returns global config value based on config name.
|
static ConfigRegistry |
getInstance() |
String |
getInstanceConfigValue(String instanceId,
String configKey)
Returns instance config value based on instance id and config name.
|
void |
initRegistry(Map<String,String> runtimeParams,
Path ballerinaConfPath)
Prepares for parsing and loading the configurations by initializing the config processor.
|
void |
loadConfigurations()
Prompts the config processor to process and load the configurations to the config registry.
|
protected void |
setGlobalConfigs(Map<String,String> globalConfigMap)
Sets global config properties as a map.
|
protected void |
setInstanceConfigs(Map<String,Map<String,String>> instanceConfigMap)
Sets instance config properties as a map.
|
public static ConfigRegistry getInstance()
public void initRegistry(Map<String,String> runtimeParams, Path ballerinaConfPath)
runtimeParams
- The Ballerina runtime parameters (-B params)ballerinaConfPath
- Path to the default ballerina.conf filepublic void loadConfigurations() throws ConfigFileParserException
ConfigFileParserException
- Thrown if the config parsing failedprotected void setGlobalConfigs(Map<String,String> globalConfigMap)
globalConfigMap
- Processed map of key value pairs.public String getGlobalConfigValue(String configKey)
configKey
- The key used to look up a configurationprotected void setInstanceConfigs(Map<String,Map<String,String>> instanceConfigMap)
instanceConfigMap
- The final, resolved map of key value pairs.public String getInstanceConfigValue(String instanceId, String configKey)
instanceId
- The ID of the instance whose configurations which need to be looked upconfigKey
- The key for the configuration to be looked upCopyright © 2018 WSO2. All rights reserved.