Search in sources :

Example 1 with CompileTimeModelProperty

use of org.mule.runtime.module.extension.internal.loader.java.property.CompileTimeModelProperty in project mule by mulesoft.

the class DefaultJavaModelLoaderDelegate method declare.

/**
 * {@inheritDoc}
 */
@Override
public ExtensionDeclarer declare(ExtensionLoadingContext context) {
    ExtensionDeclarer declarer = context.getExtensionDeclarer().named(extensionElement.getName()).onVersion(version).fromVendor(extensionElement.getVendor()).withCategory(extensionElement.getCategory()).withModelProperty(new ExtensionTypeDescriptorModelProperty(extensionElement));
    // TODO MULE-14517: This workaround should be replaced for a better and more complete mechanism
    context.getParameter("COMPILATION_MODE").ifPresent(m -> declarer.withModelProperty(new CompileTimeModelProperty()));
    extensionElement.getDeclaringClass().ifPresent(extensionClass -> declarer.withModelProperty(new ImplementingTypeModelProperty(extensionClass)));
    processLicenseRequirements(declarer);
    parseExternalLibs(extensionElement, declarer);
    addExceptionEnricher(extensionElement, declarer);
    configLoaderDelegate.declareConfigurations(declarer, extensionElement);
    connectionProviderModelLoaderDelegate.declareConnectionProviders(declarer, extensionElement);
    if (!isEmpty(extensionElement.getConfigurations())) {
        operationLoaderDelegate.declareOperations(declarer, declarer, null, extensionElement.getOperations(), false);
        functionModelLoaderDelegate.declareFunctions(declarer, declarer, null, extensionElement.getFunctions());
        extensionElement.getSources().forEach(source -> sourceModelLoaderDelegate.declareMessageSource(declarer, declarer, source, false));
    }
    return declarer;
}
Also used : ExtensionTypeDescriptorModelProperty(org.mule.runtime.module.extension.internal.loader.java.type.property.ExtensionTypeDescriptorModelProperty) ExtensionDeclarer(org.mule.runtime.api.meta.model.declaration.fluent.ExtensionDeclarer) CompileTimeModelProperty(org.mule.runtime.module.extension.internal.loader.java.property.CompileTimeModelProperty) ImplementingTypeModelProperty(org.mule.runtime.module.extension.internal.loader.java.property.ImplementingTypeModelProperty)

Aggregations

ExtensionDeclarer (org.mule.runtime.api.meta.model.declaration.fluent.ExtensionDeclarer)1 CompileTimeModelProperty (org.mule.runtime.module.extension.internal.loader.java.property.CompileTimeModelProperty)1 ImplementingTypeModelProperty (org.mule.runtime.module.extension.internal.loader.java.property.ImplementingTypeModelProperty)1 ExtensionTypeDescriptorModelProperty (org.mule.runtime.module.extension.internal.loader.java.type.property.ExtensionTypeDescriptorModelProperty)1