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