use of org.mule.runtime.core.internal.el.DefaultBindingContextBuilder in project mule by mulesoft.
the class ExtensionActivator method registerExpressionFunctions.
private void registerExpressionFunctions(ExtensionModel extensionModel) {
if (extensionModel.getFunctionModels().isEmpty()) {
return;
}
ExpressionModule.Builder moduleBuilder = new DefaultExpressionModuleBuilder(new ModuleNamespace(extensionModel.getXmlDslModel().getPrefix()));
registerExpressionFunctions(extensionModel.getFunctionModels().stream(), moduleBuilder);
try {
final BindingContext bindingContext = new DefaultBindingContextBuilder().addModule(moduleBuilder.build()).build();
registerObject(muleContext, extensionModel.getName() + "GlobalBindingContextProvider", (GlobalBindingContextProvider) () -> bindingContext);
} catch (Exception e) {
throw new MuleRuntimeException(createStaticMessage(e.getMessage()), e);
}
}
Aggregations