use of org.mule.runtime.module.extension.api.loader.java.DefaultJavaExtensionModelLoader in project mule by mulesoft.
the class MuleExtensionUtils method loadExtension.
/**
* Loads a extension model
*
* @param clazz fully qualified name of the class to load.
* @param params a set of attributes to work with in each concrete implementation of {@link ExtensionModelLoader}, which will be
* responsible of extracting the mandatory parameters (while casting, if needed).
* @return an {@link ExtensionModel} that represents the class being loaded
* @throws IllegalArgumentException if there are missing entries in {@code attributes} or the type of any of them does not apply
* to the expected one.
*/
public static ExtensionModel loadExtension(Class<?> clazz, Map<String, Object> params) {
params.put(TYPE_PROPERTY_NAME, clazz.getName());
params.put(VERSION, getProductVersion());
// TODO MULE-11797: as this utils is consumed from
// org.mule.runtime.module.extension.internal.capability.xml.schema.AbstractXmlResourceFactory.generateResource(org.mule.runtime.api.meta.model.ExtensionModel),
// this util should get dropped once the ticket gets implemented.
final DslResolvingContext dslResolvingContext = getDefault(emptySet());
return new DefaultJavaExtensionModelLoader().loadExtensionModel(clazz.getClassLoader(), dslResolvingContext, params);
}
use of org.mule.runtime.module.extension.api.loader.java.DefaultJavaExtensionModelLoader in project mule by mulesoft.
the class MuleExtensionUtils method loadExtension.
public static ExtensionModel loadExtension(Class<?> clazz, Map<String, Object> params) {
params.put(TYPE_PROPERTY_NAME, clazz.getName());
params.put(VERSION, "4.0.0-SNAPSHOT");
final DslResolvingContext dslResolvingContext = getDefault(emptySet());
return new DefaultJavaExtensionModelLoader().loadExtensionModel(clazz.getClassLoader(), dslResolvingContext, params);
}
Aggregations