use of org.mule.runtime.core.privileged.el.GlobalBindingContextProvider in project mule by mulesoft.
the class DefaultExpressionManager method initialise.
@Override
public void initialise() throws InitialisationException {
if (!initialized.getAndSet(true)) {
final DataWeaveExpressionLanguageAdaptor dwExpressionLanguage = DataWeaveExpressionLanguageAdaptor.create(muleContext, registry);
MVELExpressionLanguage mvelExpressionLanguage = null;
if (registry.lookupByName(COMPATIBILITY_PLUGIN_INSTALLED).isPresent()) {
mvelExpressionLanguage = registry.<MVELExpressionLanguage>lookupByName(OBJECT_EXPRESSION_LANGUAGE).get();
}
this.expressionLanguage = new ExpressionLanguageAdaptorHandler(dwExpressionLanguage, mvelExpressionLanguage);
this.melDefault = expressionLanguage.isMelDefault();
Collection<GlobalBindingContextProvider> contextProviders = registry.lookupAllByType(GlobalBindingContextProvider.class);
contextProviders.stream().map(GlobalBindingContextProvider::getBindingContext).forEach(expressionLanguage::addGlobalBindings);
if (melDefault) {
LOGGER.warn("Using MEL as the default expression language.");
}
}
}
Aggregations