use of org.apache.camel.builder.script.RubyLanguage in project camel by apache.
the class RubyLanguageAutoConfiguration method configureRubyLanguage.
@Bean(name = "ruby-language")
@Scope("prototype")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(RubyLanguage.class)
public RubyLanguage configureRubyLanguage(CamelContext camelContext, RubyLanguageConfiguration configuration) throws Exception {
RubyLanguage language = new RubyLanguage();
if (CamelContextAware.class.isAssignableFrom(RubyLanguage.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