use of org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean in project camel by apache.
the class CoAPComponentAutoConfiguration method configureCoAPComponent.
@Lazy
@Bean(name = "coap-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(CoAPComponent.class)
public CoAPComponent configureCoAPComponent(CamelContext camelContext) throws Exception {
CoAPComponent component = new CoAPComponent();
component.setCamelContext(camelContext);
return component;
}
use of org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean in project camel by apache.
the class CometdComponentAutoConfiguration method configureCometdComponent.
@Lazy
@Bean(name = { "cometd-component", "cometds-component" })
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(CometdComponent.class)
public CometdComponent configureCometdComponent(CamelContext camelContext, CometdComponentConfiguration configuration) throws Exception {
CometdComponent component = new CometdComponent();
component.setCamelContext(camelContext);
Map<String, Object> parameters = new HashMap<>();
IntrospectionSupport.getProperties(configuration, parameters, null, false);
for (Map.Entry<String, Object> entry : parameters.entrySet()) {
Object value = entry.getValue();
Class<?> paramClass = value.getClass();
if (paramClass.getName().endsWith("NestedConfiguration")) {
Class nestedClass = null;
try {
nestedClass = (Class) paramClass.getDeclaredField("CAMEL_NESTED_CLASS").get(null);
HashMap<String, Object> nestedParameters = new HashMap<>();
IntrospectionSupport.getProperties(value, nestedParameters, null, false);
Object nestedProperty = nestedClass.newInstance();
IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), nestedProperty, nestedParameters);
entry.setValue(nestedProperty);
} catch (NoSuchFieldException e) {
}
}
}
IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), component, parameters);
return component;
}
use of org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean in project camel by apache.
the class S3ComponentAutoConfiguration method configureS3Component.
@Lazy
@Bean(name = "aws-s3-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(S3Component.class)
public S3Component configureS3Component(CamelContext camelContext) throws Exception {
S3Component component = new S3Component();
component.setCamelContext(camelContext);
return component;
}
use of org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean in project camel by apache.
the class SesComponentAutoConfiguration method configureSesComponent.
@Lazy
@Bean(name = "aws-ses-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(SesComponent.class)
public SesComponent configureSesComponent(CamelContext camelContext) throws Exception {
SesComponent component = new SesComponent();
component.setCamelContext(camelContext);
return component;
}
use of org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean in project camel by apache.
the class SnsComponentAutoConfiguration method configureSnsComponent.
@Lazy
@Bean(name = "aws-sns-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(SnsComponent.class)
public SnsComponent configureSnsComponent(CamelContext camelContext) throws Exception {
SnsComponent component = new SnsComponent();
component.setCamelContext(camelContext);
return component;
}
Aggregations