use of org.springframework.boot.autoconfigure.condition.ConditionalOnClass in project camel by apache.
the class ElasticsearchComponentAutoConfiguration method configureElasticsearchComponent.
@Lazy
@Bean(name = "elasticsearch5-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(ElasticsearchComponent.class)
public ElasticsearchComponent configureElasticsearchComponent(CamelContext camelContext) throws Exception {
ElasticsearchComponent component = new ElasticsearchComponent();
component.setCamelContext(camelContext);
return component;
}
use of org.springframework.boot.autoconfigure.condition.ConditionalOnClass in project camel by apache.
the class EtcdComponentAutoConfiguration method configureEtcdComponent.
@Lazy
@Bean(name = "etcd-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(EtcdComponent.class)
public EtcdComponent configureEtcdComponent(CamelContext camelContext) throws Exception {
EtcdComponent component = new EtcdComponent();
component.setCamelContext(camelContext);
return component;
}
use of org.springframework.boot.autoconfigure.condition.ConditionalOnClass in project camel by apache.
the class ExecComponentAutoConfiguration method configureExecComponent.
@Lazy
@Bean(name = "exec-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(ExecComponent.class)
public ExecComponent configureExecComponent(CamelContext camelContext) throws Exception {
ExecComponent component = new ExecComponent();
component.setCamelContext(camelContext);
return component;
}
use of org.springframework.boot.autoconfigure.condition.ConditionalOnClass in project camel by apache.
the class FlatpackComponentAutoConfiguration method configureFlatpackComponent.
@Lazy
@Bean(name = "flatpack-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(FlatpackComponent.class)
public FlatpackComponent configureFlatpackComponent(CamelContext camelContext) throws Exception {
FlatpackComponent component = new FlatpackComponent();
component.setCamelContext(camelContext);
return component;
}
use of org.springframework.boot.autoconfigure.condition.ConditionalOnClass in project camel by apache.
the class FlatpackDataFormatAutoConfiguration method configureFlatpackDataFormatFactory.
@Bean(name = "flatpack-dataformat-factory")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(FlatpackDataFormat.class)
public DataFormatFactory configureFlatpackDataFormatFactory(final CamelContext camelContext, final FlatpackDataFormatConfiguration configuration) {
return new DataFormatFactory() {
public DataFormat newInstance() {
FlatpackDataFormat dataformat = new FlatpackDataFormat();
if (CamelContextAware.class.isAssignableFrom(FlatpackDataFormat.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;
}
};
}
Aggregations