use of org.apache.camel.language.spel.SpelLanguage in project camel by apache.
the class SpelLanguageAutoConfiguration method configureSpelLanguage.
@Bean(name = "spel-language")
@Scope("prototype")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(SpelLanguage.class)
public SpelLanguage configureSpelLanguage(CamelContext camelContext, SpelLanguageConfiguration configuration) throws Exception {
SpelLanguage language = new SpelLanguage();
if (CamelContextAware.class.isAssignableFrom(SpelLanguage.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