Search in sources :

Example 1 with TwitterMentionComponent

use of org.foo.mention.TwitterMentionComponent 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;
}
Also used : HashMap(java.util.HashMap) TwitterMentionComponent(org.foo.mention.TwitterMentionComponent) Lazy(org.springframework.context.annotation.Lazy) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnClass(org.springframework.boot.autoconfigure.condition.ConditionalOnClass) ConditionalOnBean(org.springframework.boot.autoconfigure.condition.ConditionalOnBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

HashMap (java.util.HashMap)1 TwitterMentionComponent (org.foo.mention.TwitterMentionComponent)1 ConditionalOnBean (org.springframework.boot.autoconfigure.condition.ConditionalOnBean)1 ConditionalOnClass (org.springframework.boot.autoconfigure.condition.ConditionalOnClass)1 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)1 Bean (org.springframework.context.annotation.Bean)1 Lazy (org.springframework.context.annotation.Lazy)1