use of org.springframework.context.annotation.Scope in project camel by apache.
the class JavaScriptLanguageAutoConfiguration method configureJavaScriptLanguage.
@Bean(name = "javaScript-language")
@Scope("prototype")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(JavaScriptLanguage.class)
public JavaScriptLanguage configureJavaScriptLanguage(CamelContext camelContext, JavaScriptLanguageConfiguration configuration) throws Exception {
JavaScriptLanguage language = new JavaScriptLanguage();
if (CamelContextAware.class.isAssignableFrom(JavaScriptLanguage.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.springframework.context.annotation.Scope in project camel by apache.
the class PythonLanguageAutoConfiguration method configurePythonLanguage.
@Bean(name = "python-language")
@Scope("prototype")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(PythonLanguage.class)
public PythonLanguage configurePythonLanguage(CamelContext camelContext, PythonLanguageConfiguration configuration) throws Exception {
PythonLanguage language = new PythonLanguage();
if (CamelContextAware.class.isAssignableFrom(PythonLanguage.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.springframework.context.annotation.Scope 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.springframework.context.annotation.Scope 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.springframework.context.annotation.Scope 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