use of org.apache.camel.language.header.HeaderLanguage in project camel by apache.
the class HeaderTest method testSingleton.
public void testSingleton() {
HeaderLanguage prop = new HeaderLanguage();
assertTrue(prop.isSingleton());
}
use of org.apache.camel.language.header.HeaderLanguage in project camel by apache.
the class HeaderLanguageAutoConfiguration method configureHeaderLanguage.
@Bean(name = "header-language")
@Scope("prototype")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(HeaderLanguage.class)
public HeaderLanguage configureHeaderLanguage(CamelContext camelContext, HeaderLanguageConfiguration configuration) throws Exception {
HeaderLanguage language = new HeaderLanguage();
if (CamelContextAware.class.isAssignableFrom(HeaderLanguage.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