Search in sources :

Example 1 with NoReconnectionStrategyModelProperty

use of org.mule.runtime.extension.internal.property.NoReconnectionStrategyModelProperty in project mule by mulesoft.

the class XmlExtensionLoaderDelegate method loadPropertiesFrom.

private Optional<ConfigurationDeclarer> loadPropertiesFrom(ExtensionDeclarer declarer, ComponentModel moduleModel, Set<ExtensionModel> extensions) {
    List<ComponentModel> globalElementsComponentModel = extractGlobalElementsFrom(moduleModel);
    List<ComponentModel> configurationProperties = extractProperties(moduleModel);
    List<ComponentModel> connectionProperties = extractConnectionProperties(moduleModel);
    validateProperties(configurationProperties, connectionProperties);
    if (!configurationProperties.isEmpty() || !connectionProperties.isEmpty() || !globalElementsComponentModel.isEmpty()) {
        declarer.withModelProperty(new NoReconnectionStrategyModelProperty());
        ConfigurationDeclarer configurationDeclarer = declarer.withConfig(CONFIG_NAME);
        configurationDeclarer.withModelProperty(new GlobalElementComponentModelModelProperty(globalElementsComponentModel));
        configurationProperties.stream().forEach(param -> extractProperty(configurationDeclarer, param));
        addConnectionProvider(configurationDeclarer, connectionProperties, globalElementsComponentModel, extensions);
        return of(configurationDeclarer);
    }
    return empty();
}
Also used : NoReconnectionStrategyModelProperty(org.mule.runtime.extension.internal.property.NoReconnectionStrategyModelProperty) GlobalElementComponentModelModelProperty(org.mule.runtime.config.internal.dsl.model.extension.xml.property.GlobalElementComponentModelModelProperty) ConfigurationDeclarer(org.mule.runtime.api.meta.model.declaration.fluent.ConfigurationDeclarer) ComponentModel(org.mule.runtime.config.internal.model.ComponentModel)

Aggregations

ConfigurationDeclarer (org.mule.runtime.api.meta.model.declaration.fluent.ConfigurationDeclarer)1 GlobalElementComponentModelModelProperty (org.mule.runtime.config.internal.dsl.model.extension.xml.property.GlobalElementComponentModelModelProperty)1 ComponentModel (org.mule.runtime.config.internal.model.ComponentModel)1 NoReconnectionStrategyModelProperty (org.mule.runtime.extension.internal.property.NoReconnectionStrategyModelProperty)1