Search in sources :

Example 1 with RouteComponentParser

use of org.mule.runtime.module.extension.internal.config.dsl.construct.RouteComponentParser in project mule by mulesoft.

the class ExtensionDefinitionParser method parseRoute.

private void parseRoute(NestedRouteModel routeModel) {
    DslElementSyntax routeDsl = dslResolver.resolve(routeModel);
    Class<?> type = routeModel.getModelProperty(ImplementingTypeModelProperty.class).map(ImplementingTypeModelProperty::getType).orElseThrow(() -> new IllegalStateException("Missing route information"));
    MetadataType metadataType = typeLoader.load(type);
    addParameter(getChildKey(routeModel.getName()), new DefaultObjectParsingDelegate().parse(routeModel.getName(), (ObjectType) metadataType, routeDsl));
    try {
        new RouteComponentParser(baseDefinitionBuilder, routeModel, metadataType, getContextClassLoader(), routeDsl, dslResolver, parsingContext).parse().forEach(this::addDefinition);
    } catch (Exception e) {
        throw new MuleRuntimeException(new ConfigurationException(e));
    }
}
Also used : ObjectType(org.mule.metadata.api.model.ObjectType) ConfigurationException(org.mule.runtime.core.api.config.ConfigurationException) DslElementSyntax(org.mule.runtime.extension.api.dsl.syntax.DslElementSyntax) DefaultObjectParsingDelegate(org.mule.runtime.module.extension.internal.config.dsl.object.DefaultObjectParsingDelegate) MetadataType(org.mule.metadata.api.model.MetadataType) MuleRuntimeException(org.mule.runtime.api.exception.MuleRuntimeException) RouteComponentParser(org.mule.runtime.module.extension.internal.config.dsl.construct.RouteComponentParser) MuleRuntimeException(org.mule.runtime.api.exception.MuleRuntimeException) DateTimeParseException(java.time.format.DateTimeParseException) ConfigurationException(org.mule.runtime.core.api.config.ConfigurationException)

Aggregations

DateTimeParseException (java.time.format.DateTimeParseException)1 MetadataType (org.mule.metadata.api.model.MetadataType)1 ObjectType (org.mule.metadata.api.model.ObjectType)1 MuleRuntimeException (org.mule.runtime.api.exception.MuleRuntimeException)1 ConfigurationException (org.mule.runtime.core.api.config.ConfigurationException)1 DslElementSyntax (org.mule.runtime.extension.api.dsl.syntax.DslElementSyntax)1 RouteComponentParser (org.mule.runtime.module.extension.internal.config.dsl.construct.RouteComponentParser)1 DefaultObjectParsingDelegate (org.mule.runtime.module.extension.internal.config.dsl.object.DefaultObjectParsingDelegate)1