use of org.apache.camel.builder.script.PythonLanguage 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;
}
Aggregations