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