Search in sources :

Example 1 with GlobalPropertyConfigurationPropertiesProvider

use of org.mule.runtime.config.internal.dsl.model.config.GlobalPropertyConfigurationPropertiesProvider in project mule by mulesoft.

the class ApplicationModel method createProviderFromGlobalProperties.

private ConfigurationPropertiesProvider createProviderFromGlobalProperties(ArtifactConfig artifactConfig) {
    final Map<String, ConfigurationProperty> globalProperties = new HashMap<>();
    artifactConfig.getConfigFiles().stream().forEach(configFile -> {
        configFile.getConfigLines().get(0).getChildren().stream().forEach(configLine -> {
            if (GLOBAL_PROPERTY.equals(configLine.getIdentifier())) {
                String key = configLine.getConfigAttributes().get("name").getValue();
                String rawValue = configLine.getConfigAttributes().get("value").getValue();
                globalProperties.put(key, new DefaultConfigurationProperty(format("global-property - file: %s - lineNumber %s", configFile.getFilename(), configLine.getLineNumber()), key, rawValue));
            }
        });
    });
    return new GlobalPropertyConfigurationPropertiesProvider(globalProperties);
}
Also used : ConfigurationProperty(org.mule.runtime.config.api.dsl.model.properties.ConfigurationProperty) DefaultConfigurationProperty(org.mule.runtime.config.internal.dsl.model.config.DefaultConfigurationProperty) GlobalPropertyConfigurationPropertiesProvider(org.mule.runtime.config.internal.dsl.model.config.GlobalPropertyConfigurationPropertiesProvider) HashMap(java.util.HashMap) DefaultConfigurationProperty(org.mule.runtime.config.internal.dsl.model.config.DefaultConfigurationProperty)

Aggregations

HashMap (java.util.HashMap)1 ConfigurationProperty (org.mule.runtime.config.api.dsl.model.properties.ConfigurationProperty)1 DefaultConfigurationProperty (org.mule.runtime.config.internal.dsl.model.config.DefaultConfigurationProperty)1 GlobalPropertyConfigurationPropertiesProvider (org.mule.runtime.config.internal.dsl.model.config.GlobalPropertyConfigurationPropertiesProvider)1