Search in sources :

Example 1 with ComponentBuildingDefinitionRegistry

use of org.mule.runtime.config.api.dsl.model.ComponentBuildingDefinitionRegistry in project mule by mulesoft.

the class ApplicationModel method executeOnEveryRootElementWithBuildingDefinition.

private void executeOnEveryRootElementWithBuildingDefinition(BiConsumer<ComponentModel, ComponentBuildingDefinition> action) {
    if (componentBuildingDefinitionRegistry.isPresent()) {
        ComponentBuildingDefinitionRegistry definitionRegistry = componentBuildingDefinitionRegistry.get();
        this.executeOnEveryRootElement(componentModel -> {
            Optional<ComponentBuildingDefinition<?>> buildingDefinition = definitionRegistry.getBuildingDefinition(componentModel.getIdentifier());
            buildingDefinition.ifPresent(componentBuildingDefinition -> {
                action.accept(componentModel, componentBuildingDefinition);
            });
        });
    }
}
Also used : ComponentBuildingDefinitionRegistry(org.mule.runtime.config.api.dsl.model.ComponentBuildingDefinitionRegistry) ComponentBuildingDefinition(org.mule.runtime.dsl.api.component.ComponentBuildingDefinition)

Aggregations

ComponentBuildingDefinitionRegistry (org.mule.runtime.config.api.dsl.model.ComponentBuildingDefinitionRegistry)1 ComponentBuildingDefinition (org.mule.runtime.dsl.api.component.ComponentBuildingDefinition)1