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