use of org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean in project camel by apache.
the class SalesforceUpsertContactConnectorAutoConfiguration method configureSalesforceUpsertContactComponent.
@Lazy
@Bean(name = "salesforce-upsert-contact-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(org.foo.salesforce.contact.SalesforceUpsertContactComponent.class)
public SalesforceUpsertContactComponent configureSalesforceUpsertContactComponent(CamelContext camelContext, SalesforceUpsertContactConnectorConfiguration configuration) throws Exception {
SalesforceUpsertContactComponent connector = new SalesforceUpsertContactComponent();
connector.setCamelContext(camelContext);
Map<String, Object> parameters = new HashMap<>();
IntrospectionSupport.getProperties(configuration, parameters, null, false);
IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), connector, parameters);
connector.setComponentOptions(parameters);
return connector;
}
use of org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean in project camel by apache.
the class TwitterMentionConnectorAutoConfiguration method configureTwitterMentionComponent.
@Lazy
@Bean(name = "twitter-mention-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(org.foo.mention.TwitterMentionComponent.class)
public TwitterMentionComponent configureTwitterMentionComponent(CamelContext camelContext, TwitterMentionConnectorConfiguration configuration) throws Exception {
TwitterMentionComponent connector = new TwitterMentionComponent();
connector.setCamelContext(camelContext);
Map<String, Object> parameters = new HashMap<>();
IntrospectionSupport.getProperties(configuration, parameters, null, false);
IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), connector, parameters);
connector.setComponentOptions(parameters);
return connector;
}
use of org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean in project camel by apache.
the class ICalDataFormatAutoConfiguration method configureICalDataFormatFactory.
@Bean(name = "ical-dataformat-factory")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(ICalDataFormat.class)
public DataFormatFactory configureICalDataFormatFactory(final CamelContext camelContext, final ICalDataFormatConfiguration configuration) {
return new DataFormatFactory() {
public DataFormat newInstance() {
ICalDataFormat dataformat = new ICalDataFormat();
if (CamelContextAware.class.isAssignableFrom(ICalDataFormat.class)) {
CamelContextAware contextAware = CamelContextAware.class.cast(dataformat);
if (contextAware != null) {
contextAware.setCamelContext(camelContext);
}
}
try {
Map<String, Object> parameters = new HashMap<>();
IntrospectionSupport.getProperties(configuration, parameters, null, false);
IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), dataformat, parameters);
} catch (Exception e) {
throw new RuntimeCamelException(e);
}
return dataformat;
}
};
}
use of org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean in project camel by apache.
the class InfluxDbComponentAutoConfiguration method configureInfluxDbComponent.
@Lazy
@Bean(name = "influxdb-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(InfluxDbComponent.class)
public InfluxDbComponent configureInfluxDbComponent(CamelContext camelContext) throws Exception {
InfluxDbComponent component = new InfluxDbComponent();
component.setCamelContext(camelContext);
return component;
}
use of org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean in project camel by apache.
the class IrcComponentAutoConfiguration method configureIrcComponent.
@Lazy
@Bean(name = "irc-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(IrcComponent.class)
public IrcComponent configureIrcComponent(CamelContext camelContext) throws Exception {
IrcComponent component = new IrcComponent();
component.setCamelContext(camelContext);
return component;
}
Aggregations