use of org.apache.camel.CamelContextAware 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;
}
use of org.apache.camel.CamelContextAware 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;
}
use of org.apache.camel.CamelContextAware 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;
}
use of org.apache.camel.CamelContextAware in project camel by apache.
the class FileLanguageAutoConfiguration method configureFileLanguage.
@Bean(name = "file-language")
@Scope("prototype")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(FileLanguage.class)
public FileLanguage configureFileLanguage(CamelContext camelContext, FileLanguageConfiguration configuration) throws Exception {
FileLanguage language = new FileLanguage();
if (CamelContextAware.class.isAssignableFrom(FileLanguage.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;
}
use of org.apache.camel.CamelContextAware in project camel by apache.
the class SimpleLanguageAutoConfiguration method configureSimpleLanguage.
@Bean(name = "simple-language")
@Scope("prototype")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(SimpleLanguage.class)
public SimpleLanguage configureSimpleLanguage(CamelContext camelContext, SimpleLanguageConfiguration configuration) throws Exception {
SimpleLanguage language = new SimpleLanguage();
if (CamelContextAware.class.isAssignableFrom(SimpleLanguage.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