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