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