Java Code Examples for org.apache.camel.support.IntrospectionSupport#getProperties()
The following examples show how to use
org.apache.camel.support.IntrospectionSupport#getProperties() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HazelcastMultimapComponentAutoConfiguration.java From camel-spring-boot with Apache License 2.0 | 5 votes |
@Lazy @Bean(name = "hazelcast-multimap-component") @ConditionalOnMissingBean(HazelcastMultimapComponent.class) public HazelcastMultimapComponent configureHazelcastMultimapComponent() throws Exception { HazelcastMultimapComponent component = new HazelcastMultimapComponent(); component.setCamelContext(camelContext); Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); CamelPropertiesHelper.setCamelProperties(camelContext, component, parameters, false); if (ObjectHelper.isNotEmpty(customizers)) { for (ComponentCustomizer<HazelcastMultimapComponent> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.component.customizer", "camel.component.hazelcast-multimap.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.component.customizer", "camel.component.hazelcast-multimap.customizer"); if (useCustomizer) { LOGGER.debug("Configure component {}, with customizer {}", component, customizer); customizer.customize(component); } } } return component; }
Example 2
Source File: CordaComponentAutoConfiguration.java From camel-spring-boot with Apache License 2.0 | 5 votes |
@Lazy @Bean(name = "corda-component") @ConditionalOnMissingBean(CordaComponent.class) public CordaComponent configureCordaComponent() throws Exception { CordaComponent component = new CordaComponent(); component.setCamelContext(camelContext); Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); CamelPropertiesHelper.setCamelProperties(camelContext, component, parameters, false); if (ObjectHelper.isNotEmpty(customizers)) { for (ComponentCustomizer<CordaComponent> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.component.customizer", "camel.component.corda.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.component.customizer", "camel.component.corda.customizer"); if (useCustomizer) { LOGGER.debug("Configure component {}, with customizer {}", component, customizer); customizer.customize(component); } } } return component; }
Example 3
Source File: BoxComponentAutoConfiguration.java From camel-spring-boot with Apache License 2.0 | 5 votes |
@Lazy @Bean(name = "box-component") @ConditionalOnMissingBean(BoxComponent.class) public BoxComponent configureBoxComponent() throws Exception { BoxComponent component = new BoxComponent(); component.setCamelContext(camelContext); Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); CamelPropertiesHelper.setCamelProperties(camelContext, component, parameters, false); if (ObjectHelper.isNotEmpty(customizers)) { for (ComponentCustomizer<BoxComponent> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.component.customizer", "camel.component.box.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.component.customizer", "camel.component.box.customizer"); if (useCustomizer) { LOGGER.debug("Configure component {}, with customizer {}", component, customizer); customizer.customize(component); } } } return component; }
Example 4
Source File: JBPMComponentAutoConfiguration.java From camel-spring-boot with Apache License 2.0 | 5 votes |
@Lazy @Bean(name = "jbpm-component") @ConditionalOnMissingBean(JBPMComponent.class) public JBPMComponent configureJBPMComponent() throws Exception { JBPMComponent component = new JBPMComponent(); component.setCamelContext(camelContext); Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); CamelPropertiesHelper.setCamelProperties(camelContext, component, parameters, false); if (ObjectHelper.isNotEmpty(customizers)) { for (ComponentCustomizer<JBPMComponent> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.component.customizer", "camel.component.jbpm.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.component.customizer", "camel.component.jbpm.customizer"); if (useCustomizer) { LOGGER.debug("Configure component {}, with customizer {}", component, customizer); customizer.customize(component); } } } return component; }
Example 5
Source File: HystrixAutoConfiguration.java From camel-spring-boot with Apache License 2.0 | 5 votes |
@PostConstruct public void postConstruct() { if (beanFactory == null) { return; } Map<String, Object> properties = new HashMap<>(); for (Map.Entry<String, HystrixConfigurationDefinitionCommon> entry : config.getConfigurations().entrySet()) { // clear the properties map for reuse properties.clear(); // extract properties IntrospectionSupport.getProperties(entry.getValue(), properties, null, false); try { HystrixConfigurationDefinition definition = new HystrixConfigurationDefinition(); IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), definition, properties); // Registry the definition beanFactory.registerSingleton(entry.getKey(), definition); } catch (Exception e) { throw new BeanCreationException(entry.getKey(), e); } } }
Example 6
Source File: IgniteCacheComponentAutoConfiguration.java From camel-spring-boot with Apache License 2.0 | 5 votes |
@Lazy @Bean(name = "ignite-cache-component") @ConditionalOnMissingBean(IgniteCacheComponent.class) public IgniteCacheComponent configureIgniteCacheComponent() throws Exception { IgniteCacheComponent component = new IgniteCacheComponent(); component.setCamelContext(camelContext); Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); CamelPropertiesHelper.setCamelProperties(camelContext, component, parameters, false); if (ObjectHelper.isNotEmpty(customizers)) { for (ComponentCustomizer<IgniteCacheComponent> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.component.customizer", "camel.component.ignite-cache.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.component.customizer", "camel.component.ignite-cache.customizer"); if (useCustomizer) { LOGGER.debug("Configure component {}, with customizer {}", component, customizer); customizer.customize(component); } } } return component; }
Example 7
Source File: SedaComponentAutoConfiguration.java From camel-spring-boot with Apache License 2.0 | 5 votes |
@Lazy @Bean(name = "seda-component") @ConditionalOnMissingBean(SedaComponent.class) public SedaComponent configureSedaComponent() throws Exception { SedaComponent component = new SedaComponent(); component.setCamelContext(camelContext); Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); CamelPropertiesHelper.setCamelProperties(camelContext, component, parameters, false); if (ObjectHelper.isNotEmpty(customizers)) { for (ComponentCustomizer<SedaComponent> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.component.customizer", "camel.component.seda.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.component.customizer", "camel.component.seda.customizer"); if (useCustomizer) { LOGGER.debug("Configure component {}, with customizer {}", component, customizer); customizer.customize(component); } } } return component; }
Example 8
Source File: BraintreeComponentAutoConfiguration.java From camel-spring-boot with Apache License 2.0 | 5 votes |
@Lazy @Bean(name = "braintree-component") @ConditionalOnMissingBean(BraintreeComponent.class) public BraintreeComponent configureBraintreeComponent() throws Exception { BraintreeComponent component = new BraintreeComponent(); component.setCamelContext(camelContext); Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); CamelPropertiesHelper.setCamelProperties(camelContext, component, parameters, false); if (ObjectHelper.isNotEmpty(customizers)) { for (ComponentCustomizer<BraintreeComponent> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.component.customizer", "camel.component.braintree.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.component.customizer", "camel.component.braintree.customizer"); if (useCustomizer) { LOGGER.debug("Configure component {}, with customizer {}", component, customizer); customizer.customize(component); } } } return component; }
Example 9
Source File: SwiftComponentAutoConfiguration.java From camel-spring-boot with Apache License 2.0 | 5 votes |
@Lazy @Bean(name = "openstack-swift-component") @ConditionalOnMissingBean(SwiftComponent.class) public SwiftComponent configureSwiftComponent() throws Exception { SwiftComponent component = new SwiftComponent(); component.setCamelContext(camelContext); Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); CamelPropertiesHelper.setCamelProperties(camelContext, component, parameters, false); if (ObjectHelper.isNotEmpty(customizers)) { for (ComponentCustomizer<SwiftComponent> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.component.customizer", "camel.component.openstack-swift.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.component.customizer", "camel.component.openstack-swift.customizer"); if (useCustomizer) { LOGGER.debug("Configure component {}, with customizer {}", component, customizer); customizer.customize(component); } } } return component; }
Example 10
Source File: XPathLanguageAutoConfiguration.java From camel-spring-boot with Apache License 2.0 | 5 votes |
@Bean(name = "xpath-language") @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) @ConditionalOnMissingBean(XPathLanguage.class) public XPathLanguage configureXPathLanguage() throws Exception { XPathLanguage language = new XPathLanguage(); if (CamelContextAware.class.isAssignableFrom(XPathLanguage.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); CamelPropertiesHelper.setCamelProperties(camelContext, language, parameters, false); if (ObjectHelper.isNotEmpty(customizers)) { for (LanguageCustomizer<XPathLanguage> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.language.customizer", "camel.language.xpath.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.language.customizer", "camel.language.xpath.customizer"); if (useCustomizer) { LOGGER.debug("Configure language {}, with customizer {}", language, customizer); customizer.customize(language); } } } return language; }
Example 11
Source File: GraphqlComponentAutoConfiguration.java From camel-spring-boot with Apache License 2.0 | 5 votes |
@Lazy @Bean(name = "graphql-component") @ConditionalOnMissingBean(GraphqlComponent.class) public GraphqlComponent configureGraphqlComponent() throws Exception { GraphqlComponent component = new GraphqlComponent(); component.setCamelContext(camelContext); Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); CamelPropertiesHelper.setCamelProperties(camelContext, component, parameters, false); if (ObjectHelper.isNotEmpty(customizers)) { for (ComponentCustomizer<GraphqlComponent> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.component.customizer", "camel.component.graphql.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.component.customizer", "camel.component.graphql.customizer"); if (useCustomizer) { LOGGER.debug("Configure component {}, with customizer {}", component, customizer); customizer.customize(component); } } } return component; }
Example 12
Source File: ResilienceAutoConfiguration.java From camel-spring-boot with Apache License 2.0 | 5 votes |
@PostConstruct public void postConstruct() { if (beanFactory == null) { return; } Map<String, Object> properties = new HashMap<>(); for (Map.Entry<String, Resilience4jConfigurationDefinitionCommon> entry : config.getConfigurations().entrySet()) { // clear the properties map for reuse properties.clear(); // extract properties IntrospectionSupport.getProperties(entry.getValue(), properties, null, false); try { Resilience4jConfigurationDefinition definition = new Resilience4jConfigurationDefinition(); IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), definition, properties); // Registry the definition beanFactory.registerSingleton(entry.getKey(), definition); } catch (Exception e) { throw new BeanCreationException(entry.getKey(), e); } } }
Example 13
Source File: ExecComponentAutoConfiguration.java From camel-spring-boot with Apache License 2.0 | 5 votes |
@Lazy @Bean(name = "exec-component") @ConditionalOnMissingBean(ExecComponent.class) public ExecComponent configureExecComponent() throws Exception { ExecComponent component = new ExecComponent(); component.setCamelContext(camelContext); Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); CamelPropertiesHelper.setCamelProperties(camelContext, component, parameters, false); if (ObjectHelper.isNotEmpty(customizers)) { for (ComponentCustomizer<ExecComponent> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.component.customizer", "camel.component.exec.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.component.customizer", "camel.component.exec.customizer"); if (useCustomizer) { LOGGER.debug("Configure component {}, with customizer {}", component, customizer); customizer.customize(component); } } } return component; }
Example 14
Source File: Olingo4ComponentAutoConfiguration.java From camel-spring-boot with Apache License 2.0 | 5 votes |
@Lazy @Bean(name = "olingo4-component") @ConditionalOnMissingBean(Olingo4Component.class) public Olingo4Component configureOlingo4Component() throws Exception { Olingo4Component component = new Olingo4Component(); component.setCamelContext(camelContext); Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); CamelPropertiesHelper.setCamelProperties(camelContext, component, parameters, false); if (ObjectHelper.isNotEmpty(customizers)) { for (ComponentCustomizer<Olingo4Component> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.component.customizer", "camel.component.olingo4.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.component.customizer", "camel.component.olingo4.customizer"); if (useCustomizer) { LOGGER.debug("Configure component {}, with customizer {}", component, customizer); customizer.customize(component); } } } return component; }
Example 15
Source File: PrinterComponentAutoConfiguration.java From camel-spring-boot with Apache License 2.0 | 5 votes |
@Lazy @Bean(name = "lpr-component") @ConditionalOnMissingBean(PrinterComponent.class) public PrinterComponent configurePrinterComponent() throws Exception { PrinterComponent component = new PrinterComponent(); component.setCamelContext(camelContext); Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); CamelPropertiesHelper.setCamelProperties(camelContext, component, parameters, false); if (ObjectHelper.isNotEmpty(customizers)) { for (ComponentCustomizer<PrinterComponent> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.component.customizer", "camel.component.lpr.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.component.customizer", "camel.component.lpr.customizer"); if (useCustomizer) { LOGGER.debug("Configure component {}, with customizer {}", component, customizer); customizer.customize(component); } } } return component; }
Example 16
Source File: HazelcastReplicatedmapComponentAutoConfiguration.java From camel-spring-boot with Apache License 2.0 | 5 votes |
@Lazy @Bean(name = "hazelcast-replicatedmap-component") @ConditionalOnMissingBean(HazelcastReplicatedmapComponent.class) public HazelcastReplicatedmapComponent configureHazelcastReplicatedmapComponent() throws Exception { HazelcastReplicatedmapComponent component = new HazelcastReplicatedmapComponent(); component.setCamelContext(camelContext); Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); CamelPropertiesHelper.setCamelProperties(camelContext, component, parameters, false); if (ObjectHelper.isNotEmpty(customizers)) { for (ComponentCustomizer<HazelcastReplicatedmapComponent> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.component.customizer", "camel.component.hazelcast-replicatedmap.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.component.customizer", "camel.component.hazelcast-replicatedmap.customizer"); if (useCustomizer) { LOGGER.debug("Configure component {}, with customizer {}", component, customizer); customizer.customize(component); } } } return component; }
Example 17
Source File: XStreamDataFormatAutoConfiguration.java From camel-spring-boot with Apache License 2.0 | 4 votes |
@Bean(name = "xstream-dataformat-factory") @ConditionalOnMissingBean(XStreamDataFormat.class) public DataFormatFactory configureXStreamDataFormatFactory() throws Exception { return new DataFormatFactory() { @Override public DataFormat newInstance() { XStreamDataFormat dataformat = new XStreamDataFormat(); if (CamelContextAware.class .isAssignableFrom(XStreamDataFormat.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); CamelPropertiesHelper.setCamelProperties(camelContext, dataformat, parameters, false); } catch (Exception e) { throw new RuntimeCamelException(e); } if (ObjectHelper.isNotEmpty(customizers)) { for (DataFormatCustomizer<XStreamDataFormat> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.dataformat.customizer", "camel.dataformat.xstream.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.dataformat.customizer", "camel.dataformat.xstream.customizer"); if (useCustomizer) { LOGGER.debug( "Configure dataformat {}, with customizer {}", dataformat, customizer); customizer.customize(dataformat); } } } return dataformat; } }; }
Example 18
Source File: TidyMarkupDataFormatAutoConfiguration.java From camel-spring-boot with Apache License 2.0 | 4 votes |
@Bean(name = "tidyMarkup-dataformat-factory") @ConditionalOnMissingBean(TidyMarkupDataFormat.class) public DataFormatFactory configureTidyMarkupDataFormatFactory() throws Exception { return new DataFormatFactory() { @Override public DataFormat newInstance() { TidyMarkupDataFormat dataformat = new TidyMarkupDataFormat(); if (CamelContextAware.class .isAssignableFrom(TidyMarkupDataFormat.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); CamelPropertiesHelper.setCamelProperties(camelContext, dataformat, parameters, false); } catch (Exception e) { throw new RuntimeCamelException(e); } if (ObjectHelper.isNotEmpty(customizers)) { for (DataFormatCustomizer<TidyMarkupDataFormat> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.dataformat.customizer", "camel.dataformat.tidymarkup.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.dataformat.customizer", "camel.dataformat.tidymarkup.customizer"); if (useCustomizer) { LOGGER.debug( "Configure dataformat {}, with customizer {}", dataformat, customizer); customizer.customize(dataformat); } } } return dataformat; } }; }
Example 19
Source File: RestConfigurationDefinitionAutoConfiguration.java From camel-spring-boot with Apache License 2.0 | 4 votes |
@Lazy @Bean(name = RestComponent.DEFAULT_REST_CONFIGURATION_ID) @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean public RestConfiguration configureRestConfigurationDefinition() throws Exception { Map<String, Object> properties = new HashMap<>(); IntrospectionSupport.getProperties(config, properties, null, false); // These options is configured specially further below, so remove them first properties.remove("enableCors"); properties.remove("apiProperty"); properties.remove("componentProperty"); properties.remove("consumerProperty"); properties.remove("dataFormatProperty"); properties.remove("endpointProperty"); properties.remove("corsHeaders"); RestConfiguration definition = new RestConfiguration(); CamelPropertiesHelper.setCamelProperties(camelContext, definition, properties, true); // Workaround for spring-boot properties name as It would appear // as enable-c-o-r-s if left uppercase in Configuration definition.setEnableCORS(config.getEnableCors()); if (config.getApiProperty() != null) { definition.setApiProperties(new HashMap<>(CollectionHelper.flattenKeysInMap(config.getApiProperty(), "."))); } if (config.getComponentProperty() != null) { definition.setComponentProperties(new HashMap<>(CollectionHelper.flattenKeysInMap(config.getComponentProperty(), "."))); } if (config.getConsumerProperty() != null) { definition.setConsumerProperties(new HashMap<>(CollectionHelper.flattenKeysInMap(config.getConsumerProperty(), "."))); } if (config.getDataFormatProperty() != null) { definition.setDataFormatProperties(new HashMap<>(CollectionHelper.flattenKeysInMap(config.getDataFormatProperty(), "."))); } if (config.getEndpointProperty() != null) { definition.setEndpointProperties(new HashMap<>(CollectionHelper.flattenKeysInMap(config.getEndpointProperty(), "."))); } if (config.getCorsHeaders() != null) { Map<String, Object> map = CollectionHelper.flattenKeysInMap(config.getCorsHeaders(), "."); Map<String, String> target = new HashMap<>(); map.forEach((k, v) -> target.put(k, v.toString())); definition.setCorsHeaders(target); } return definition; }
Example 20
Source File: TarFileDataFormatAutoConfiguration.java From camel-spring-boot with Apache License 2.0 | 4 votes |
@Bean(name = "tarfile-dataformat-factory") @ConditionalOnMissingBean(TarFileDataFormat.class) public DataFormatFactory configureTarFileDataFormatFactory() throws Exception { return new DataFormatFactory() { @Override public DataFormat newInstance() { TarFileDataFormat dataformat = new TarFileDataFormat(); if (CamelContextAware.class .isAssignableFrom(TarFileDataFormat.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); CamelPropertiesHelper.setCamelProperties(camelContext, dataformat, parameters, false); } catch (Exception e) { throw new RuntimeCamelException(e); } if (ObjectHelper.isNotEmpty(customizers)) { for (DataFormatCustomizer<TarFileDataFormat> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.dataformat.customizer", "camel.dataformat.tarfile.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.dataformat.customizer", "camel.dataformat.tarfile.customizer"); if (useCustomizer) { LOGGER.debug( "Configure dataformat {}, with customizer {}", dataformat, customizer); customizer.customize(dataformat); } } } return dataformat; } }; }