use of org.apache.camel.language.ognl.OgnlLanguage in project camel by apache.
the class OgnlLanguageAutoConfiguration method configureOgnlLanguage.
@Bean(name = "ognl-language")
@Scope("prototype")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(OgnlLanguage.class)
public OgnlLanguage configureOgnlLanguage(CamelContext camelContext, OgnlLanguageConfiguration configuration) throws Exception {
OgnlLanguage language = new OgnlLanguage();
if (CamelContextAware.class.isAssignableFrom(OgnlLanguage.class)) {
CamelContextAware contextAware = CamelContextAware.class.cast(language);
if (contextAware != null) {
contextAware.setCamelContext(camelContext);
}
}
Map<String, Object> parameters = new HashMap<>();
IntrospectionSupport.getProperties(configuration, parameters, null, false);
IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), language, parameters);
return language;
}
Aggregations