http://git-wip-us.apache.org/repos/asf/camel/blob/d10555fa/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/properties/springboot/PropertiesComponentConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/properties/springboot/PropertiesComponentConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/properties/springboot/PropertiesComponentConfiguration.java new file mode 100644 index 0000000..9bb02df --- /dev/null +++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/properties/springboot/PropertiesComponentConfiguration.java @@ -0,0 +1,230 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.properties.springboot; + +import java.util.Properties; +import org.apache.camel.component.properties.PropertiesParser; +import org.apache.camel.component.properties.PropertiesResolver; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * The properties component is used for using property placeholders in endpoint + * uris. + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.component.properties") +public class PropertiesComponentConfiguration { + + /** + * A list of locations to load properties. You can use comma to separate + * multiple locations. This option will override any default locations and + * only use the locations from this option. + */ + private String[] locations; + /** + * A list of locations to load properties. You can use comma to separate + * multiple locations. This option will override any default locations and + * only use the locations from this option. + */ + private String location; + /** + * Encoding to use when loading properties file from the file system or + * classpath. If no encoding has been set then the properties files is + * loaded using ISO-8859-1 encoding (latin-1) as documented by link + * java.util.Propertiesload(java.io.InputStream) + */ + private String encoding; + /** + * To use a custom PropertiesResolver + */ + private PropertiesResolver propertiesResolver; + /** + * To use a custom PropertiesParser + */ + private PropertiesParser propertiesParser; + /** + * Whether or not to cache loaded properties. The default value is true. + */ + private Boolean cache; + /** + * Optional prefix prepended to property names before resolution. + */ + private String propertyPrefix; + /** + * Optional suffix appended to property names before resolution. + */ + private String propertySuffix; + /** + * If true first attempt resolution of property name augmented with + * propertyPrefix and propertySuffix before falling back the plain property + * name specified. If false only the augmented property name is searched. + */ + private Boolean fallbackToUnaugmentedProperty; + /** + * Whether to silently ignore if a location cannot be located such as a + * properties file not found. + */ + private Boolean ignoreMissingLocation; + /** + * Sets the value of the prefix token used to identify properties to + * replace. Setting a value of null restores the default token (link link + * DEFAULT_PREFIX_TOKEN). + */ + private String prefixToken; + /** + * Sets the value of the suffix token used to identify properties to + * replace. Setting a value of null restores the default token (link link + * DEFAULT_SUFFIX_TOKEN). + */ + private String suffixToken; + /** + * Sets initial properties which will be used before any locations are + * resolved. + */ + private Properties initialProperties; + /** + * Sets a special list of override properties that take precedence and will + * use first if a property exist. + */ + private Properties overrideProperties; + /** + * Sets the system property mode. + */ + private Integer systemPropertiesMode; + + public String[] getLocations() { + return locations; + } + + public void setLocations(String[] locations) { + this.locations = locations; + } + + public String getLocation() { + return location; + } + + public void setLocation(String location) { + this.location = location; + } + + public String getEncoding() { + return encoding; + } + + public void setEncoding(String encoding) { + this.encoding = encoding; + } + + public PropertiesResolver getPropertiesResolver() { + return propertiesResolver; + } + + public void setPropertiesResolver(PropertiesResolver propertiesResolver) { + this.propertiesResolver = propertiesResolver; + } + + public PropertiesParser getPropertiesParser() { + return propertiesParser; + } + + public void setPropertiesParser(PropertiesParser propertiesParser) { + this.propertiesParser = propertiesParser; + } + + public Boolean getCache() { + return cache; + } + + public void setCache(Boolean cache) { + this.cache = cache; + } + + public String getPropertyPrefix() { + return propertyPrefix; + } + + public void setPropertyPrefix(String propertyPrefix) { + this.propertyPrefix = propertyPrefix; + } + + public String getPropertySuffix() { + return propertySuffix; + } + + public void setPropertySuffix(String propertySuffix) { + this.propertySuffix = propertySuffix; + } + + public Boolean getFallbackToUnaugmentedProperty() { + return fallbackToUnaugmentedProperty; + } + + public void setFallbackToUnaugmentedProperty( + Boolean fallbackToUnaugmentedProperty) { + this.fallbackToUnaugmentedProperty = fallbackToUnaugmentedProperty; + } + + public Boolean getIgnoreMissingLocation() { + return ignoreMissingLocation; + } + + public void setIgnoreMissingLocation(Boolean ignoreMissingLocation) { + this.ignoreMissingLocation = ignoreMissingLocation; + } + + public String getPrefixToken() { + return prefixToken; + } + + public void setPrefixToken(String prefixToken) { + this.prefixToken = prefixToken; + } + + public String getSuffixToken() { + return suffixToken; + } + + public void setSuffixToken(String suffixToken) { + this.suffixToken = suffixToken; + } + + public Properties getInitialProperties() { + return initialProperties; + } + + public void setInitialProperties(Properties initialProperties) { + this.initialProperties = initialProperties; + } + + public Properties getOverrideProperties() { + return overrideProperties; + } + + public void setOverrideProperties(Properties overrideProperties) { + this.overrideProperties = overrideProperties; + } + + public Integer getSystemPropertiesMode() { + return systemPropertiesMode; + } + + public void setSystemPropertiesMode(Integer systemPropertiesMode) { + this.systemPropertiesMode = systemPropertiesMode; + } +} \ No newline at end of file
http://git-wip-us.apache.org/repos/asf/camel/blob/d10555fa/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/scheduler/springboot/SchedulerComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/scheduler/springboot/SchedulerComponentAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/scheduler/springboot/SchedulerComponentAutoConfiguration.java new file mode 100644 index 0000000..897a713 --- /dev/null +++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/scheduler/springboot/SchedulerComponentAutoConfiguration.java @@ -0,0 +1,52 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.scheduler.springboot; + +import java.util.HashMap; +import java.util.Map; +import org.apache.camel.CamelContext; +import org.apache.camel.component.scheduler.SchedulerComponent; +import org.apache.camel.util.IntrospectionSupport; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration +@EnableConfigurationProperties(SchedulerComponentConfiguration.class) +public class SchedulerComponentAutoConfiguration { + + @Bean(name = "scheduler-component") + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(SchedulerComponent.class) + public SchedulerComponent configureSchedulerComponent( + CamelContext camelContext, + SchedulerComponentConfiguration configuration) throws Exception { + SchedulerComponent component = new SchedulerComponent(); + component.setCamelContext(camelContext); + Map<String, Object> parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null, + false); + IntrospectionSupport.setProperties(camelContext, + camelContext.getTypeConverter(), component, parameters); + return component; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/d10555fa/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/scheduler/springboot/SchedulerComponentConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/scheduler/springboot/SchedulerComponentConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/scheduler/springboot/SchedulerComponentConfiguration.java new file mode 100644 index 0000000..de7325f --- /dev/null +++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/scheduler/springboot/SchedulerComponentConfiguration.java @@ -0,0 +1,43 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.scheduler.springboot; + +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * The scheduler component is used for generating message exchanges when a + * scheduler fires. + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.component.scheduler") +public class SchedulerComponentConfiguration { + + /** + * Number of threads used by the scheduling thread pool. Is by default using + * a single thread + */ + private Integer concurrentTasks; + + public Integer getConcurrentTasks() { + return concurrentTasks; + } + + public void setConcurrentTasks(Integer concurrentTasks) { + this.concurrentTasks = concurrentTasks; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/d10555fa/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/seda/springboot/SedaComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/seda/springboot/SedaComponentAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/seda/springboot/SedaComponentAutoConfiguration.java new file mode 100644 index 0000000..8278164 --- /dev/null +++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/seda/springboot/SedaComponentAutoConfiguration.java @@ -0,0 +1,51 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.seda.springboot; + +import java.util.HashMap; +import java.util.Map; +import org.apache.camel.CamelContext; +import org.apache.camel.component.seda.SedaComponent; +import org.apache.camel.util.IntrospectionSupport; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration +@EnableConfigurationProperties(SedaComponentConfiguration.class) +public class SedaComponentAutoConfiguration { + + @Bean(name = "seda-component") + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(SedaComponent.class) + public SedaComponent configureSedaComponent(CamelContext camelContext, + SedaComponentConfiguration configuration) throws Exception { + SedaComponent component = new SedaComponent(); + component.setCamelContext(camelContext); + Map<String, Object> parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null, + false); + IntrospectionSupport.setProperties(camelContext, + camelContext.getTypeConverter(), component, parameters); + return component; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/d10555fa/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/seda/springboot/SedaComponentConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/seda/springboot/SedaComponentConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/seda/springboot/SedaComponentConfiguration.java new file mode 100644 index 0000000..fe2c2c1 --- /dev/null +++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/seda/springboot/SedaComponentConfiguration.java @@ -0,0 +1,70 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.seda.springboot; + +import org.apache.camel.Exchange; +import org.apache.camel.component.seda.BlockingQueueFactory; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * The seda component provides asynchronous call to another endpoint from any + * CamelContext in the same JVM. + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.component.seda") +public class SedaComponentConfiguration { + + /** + * Sets the default maximum capacity of the SEDA queue (i.e. the number of + * messages it can hold). + */ + private Integer queueSize; + /** + * Sets the default number of concurrent threads processing exchanges. + */ + private Integer concurrentConsumers; + /** + * Sets the default queue factory. + */ + private BlockingQueueFactory<Exchange> defaultQueueFactory; + + public Integer getQueueSize() { + return queueSize; + } + + public void setQueueSize(Integer queueSize) { + this.queueSize = queueSize; + } + + public Integer getConcurrentConsumers() { + return concurrentConsumers; + } + + public void setConcurrentConsumers(Integer concurrentConsumers) { + this.concurrentConsumers = concurrentConsumers; + } + + public BlockingQueueFactory<Exchange> getDefaultQueueFactory() { + return defaultQueueFactory; + } + + public void setDefaultQueueFactory( + BlockingQueueFactory<Exchange> defaultQueueFactory) { + this.defaultQueueFactory = defaultQueueFactory; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/d10555fa/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/stub/springboot/StubComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/stub/springboot/StubComponentAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/stub/springboot/StubComponentAutoConfiguration.java new file mode 100644 index 0000000..451c9b9 --- /dev/null +++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/stub/springboot/StubComponentAutoConfiguration.java @@ -0,0 +1,51 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.stub.springboot; + +import java.util.HashMap; +import java.util.Map; +import org.apache.camel.CamelContext; +import org.apache.camel.component.stub.StubComponent; +import org.apache.camel.util.IntrospectionSupport; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration +@EnableConfigurationProperties(StubComponentConfiguration.class) +public class StubComponentAutoConfiguration { + + @Bean(name = "stub-component") + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(StubComponent.class) + public StubComponent configureStubComponent(CamelContext camelContext, + StubComponentConfiguration configuration) throws Exception { + StubComponent component = new StubComponent(); + component.setCamelContext(camelContext); + Map<String, Object> parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null, + false); + IntrospectionSupport.setProperties(camelContext, + camelContext.getTypeConverter(), component, parameters); + return component; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/d10555fa/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/stub/springboot/StubComponentConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/stub/springboot/StubComponentConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/stub/springboot/StubComponentConfiguration.java new file mode 100644 index 0000000..d2db266 --- /dev/null +++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/stub/springboot/StubComponentConfiguration.java @@ -0,0 +1,70 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.stub.springboot; + +import org.apache.camel.Exchange; +import org.apache.camel.component.seda.BlockingQueueFactory; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * The stub component provides a simple way to stub out any physical endpoints + * while in development or testing. + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.component.stub") +public class StubComponentConfiguration { + + /** + * Sets the default maximum capacity of the SEDA queue (i.e. the number of + * messages it can hold). + */ + private Integer queueSize; + /** + * Sets the default number of concurrent threads processing exchanges. + */ + private Integer concurrentConsumers; + /** + * Sets the default queue factory. + */ + private BlockingQueueFactory<Exchange> defaultQueueFactory; + + public Integer getQueueSize() { + return queueSize; + } + + public void setQueueSize(Integer queueSize) { + this.queueSize = queueSize; + } + + public Integer getConcurrentConsumers() { + return concurrentConsumers; + } + + public void setConcurrentConsumers(Integer concurrentConsumers) { + this.concurrentConsumers = concurrentConsumers; + } + + public BlockingQueueFactory<Exchange> getDefaultQueueFactory() { + return defaultQueueFactory; + } + + public void setDefaultQueueFactory( + BlockingQueueFactory<Exchange> defaultQueueFactory) { + this.defaultQueueFactory = defaultQueueFactory; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/d10555fa/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/validator/springboot/ValidatorComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/validator/springboot/ValidatorComponentAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/validator/springboot/ValidatorComponentAutoConfiguration.java new file mode 100644 index 0000000..1510856 --- /dev/null +++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/validator/springboot/ValidatorComponentAutoConfiguration.java @@ -0,0 +1,52 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.validator.springboot; + +import java.util.HashMap; +import java.util.Map; +import org.apache.camel.CamelContext; +import org.apache.camel.component.validator.ValidatorComponent; +import org.apache.camel.util.IntrospectionSupport; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration +@EnableConfigurationProperties(ValidatorComponentConfiguration.class) +public class ValidatorComponentAutoConfiguration { + + @Bean(name = "validator-component") + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(ValidatorComponent.class) + public ValidatorComponent configureValidatorComponent( + CamelContext camelContext, + ValidatorComponentConfiguration configuration) throws Exception { + ValidatorComponent component = new ValidatorComponent(); + component.setCamelContext(camelContext); + Map<String, Object> parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null, + false); + IntrospectionSupport.setProperties(camelContext, + camelContext.getTypeConverter(), component, parameters); + return component; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/d10555fa/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/validator/springboot/ValidatorComponentConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/validator/springboot/ValidatorComponentConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/validator/springboot/ValidatorComponentConfiguration.java new file mode 100644 index 0000000..40e5a2d --- /dev/null +++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/validator/springboot/ValidatorComponentConfiguration.java @@ -0,0 +1,44 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.validator.springboot; + +import org.apache.camel.component.validator.ValidatorResourceResolverFactory; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * Validates the payload of a message using XML Schema and JAXP Validation. + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.component.validator") +public class ValidatorComponentConfiguration { + + /** + * To use a custom LSResourceResolver which depends on a dynamic endpoint + * resource URI + */ + private ValidatorResourceResolverFactory resourceResolverFactory; + + public ValidatorResourceResolverFactory getResourceResolverFactory() { + return resourceResolverFactory; + } + + public void setResourceResolverFactory( + ValidatorResourceResolverFactory resourceResolverFactory) { + this.resourceResolverFactory = resourceResolverFactory; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/d10555fa/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/vm/springboot/VmComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/vm/springboot/VmComponentAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/vm/springboot/VmComponentAutoConfiguration.java new file mode 100644 index 0000000..8fb3b6a --- /dev/null +++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/vm/springboot/VmComponentAutoConfiguration.java @@ -0,0 +1,51 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.vm.springboot; + +import java.util.HashMap; +import java.util.Map; +import org.apache.camel.CamelContext; +import org.apache.camel.component.vm.VmComponent; +import org.apache.camel.util.IntrospectionSupport; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration +@EnableConfigurationProperties(VmComponentConfiguration.class) +public class VmComponentAutoConfiguration { + + @Bean(name = "vm-component") + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(VmComponent.class) + public VmComponent configureVmComponent(CamelContext camelContext, + VmComponentConfiguration configuration) throws Exception { + VmComponent component = new VmComponent(); + component.setCamelContext(camelContext); + Map<String, Object> parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null, + false); + IntrospectionSupport.setProperties(camelContext, + camelContext.getTypeConverter(), component, parameters); + return component; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/d10555fa/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/vm/springboot/VmComponentConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/vm/springboot/VmComponentConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/vm/springboot/VmComponentConfiguration.java new file mode 100644 index 0000000..bf6ffee --- /dev/null +++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/vm/springboot/VmComponentConfiguration.java @@ -0,0 +1,70 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.vm.springboot; + +import org.apache.camel.Exchange; +import org.apache.camel.component.seda.BlockingQueueFactory; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * The vm component provides asynchronous call to another endpoint from the same + * CamelContext. + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.component.vm") +public class VmComponentConfiguration { + + /** + * Sets the default maximum capacity of the SEDA queue (i.e. the number of + * messages it can hold). + */ + private Integer queueSize; + /** + * Sets the default number of concurrent threads processing exchanges. + */ + private Integer concurrentConsumers; + /** + * Sets the default queue factory. + */ + private BlockingQueueFactory<Exchange> defaultQueueFactory; + + public Integer getQueueSize() { + return queueSize; + } + + public void setQueueSize(Integer queueSize) { + this.queueSize = queueSize; + } + + public Integer getConcurrentConsumers() { + return concurrentConsumers; + } + + public void setConcurrentConsumers(Integer concurrentConsumers) { + this.concurrentConsumers = concurrentConsumers; + } + + public BlockingQueueFactory<Exchange> getDefaultQueueFactory() { + return defaultQueueFactory; + } + + public void setDefaultQueueFactory( + BlockingQueueFactory<Exchange> defaultQueueFactory) { + this.defaultQueueFactory = defaultQueueFactory; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/d10555fa/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/xslt/springboot/XsltComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/xslt/springboot/XsltComponentAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/xslt/springboot/XsltComponentAutoConfiguration.java new file mode 100644 index 0000000..8b927e5 --- /dev/null +++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/xslt/springboot/XsltComponentAutoConfiguration.java @@ -0,0 +1,51 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.xslt.springboot; + +import java.util.HashMap; +import java.util.Map; +import org.apache.camel.CamelContext; +import org.apache.camel.component.xslt.XsltComponent; +import org.apache.camel.util.IntrospectionSupport; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration +@EnableConfigurationProperties(XsltComponentConfiguration.class) +public class XsltComponentAutoConfiguration { + + @Bean(name = "xslt-component") + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(XsltComponent.class) + public XsltComponent configureXsltComponent(CamelContext camelContext, + XsltComponentConfiguration configuration) throws Exception { + XsltComponent component = new XsltComponent(); + component.setCamelContext(camelContext); + Map<String, Object> parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null, + false); + IntrospectionSupport.setProperties(camelContext, + camelContext.getTypeConverter(), component, parameters); + return component; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/d10555fa/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/xslt/springboot/XsltComponentConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/xslt/springboot/XsltComponentConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/xslt/springboot/XsltComponentConfiguration.java new file mode 100644 index 0000000..202f644 --- /dev/null +++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/xslt/springboot/XsltComponentConfiguration.java @@ -0,0 +1,104 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.xslt.springboot; + +import javax.xml.transform.URIResolver; +import org.apache.camel.component.xslt.XsltUriResolverFactory; +import org.apache.camel.converter.jaxp.XmlConverter; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * Transforms the message using a XSLT template. + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.component.xslt") +public class XsltComponentConfiguration { + + /** + * To use a custom implementation of + * org.apache.camel.converter.jaxp.XmlConverter + */ + private XmlConverter xmlConverter; + /** + * To use a custom javax.xml.transform.URIResolver which depends on a + * dynamic endpoint resource URI or which is a subclass of XsltUriResolver. + * Do not use in combination with uriResolver. See also link + * setUriResolver(URIResolver). + */ + private XsltUriResolverFactory uriResolverFactory; + /** + * To use a custom javax.xml.transform.URIResolver. Do not use in + * combination with uriResolverFactory. See also link + * setUriResolverFactory(XsltUriResolverFactory). + */ + private URIResolver uriResolver; + /** + * Cache for the resource content (the stylesheet file) when it is loaded. + * If set to false Camel will reload the stylesheet file on each message + * processing. This is good for development. A cached stylesheet can be + * forced to reload at runtime via JMX using the clearCachedStylesheet + * operation. + */ + private Boolean contentCache = true; + /** + * Whether to use Saxon as the transformerFactoryClass. If enabled then the + * class net.sf.saxon.TransformerFactoryImpl. You would need to add Saxon to + * the classpath. + */ + private Boolean saxon; + + public XmlConverter getXmlConverter() { + return xmlConverter; + } + + public void setXmlConverter(XmlConverter xmlConverter) { + this.xmlConverter = xmlConverter; + } + + public XsltUriResolverFactory getUriResolverFactory() { + return uriResolverFactory; + } + + public void setUriResolverFactory(XsltUriResolverFactory uriResolverFactory) { + this.uriResolverFactory = uriResolverFactory; + } + + public URIResolver getUriResolver() { + return uriResolver; + } + + public void setUriResolver(URIResolver uriResolver) { + this.uriResolver = uriResolver; + } + + public Boolean getContentCache() { + return contentCache; + } + + public void setContentCache(Boolean contentCache) { + this.contentCache = contentCache; + } + + public Boolean getSaxon() { + return saxon; + } + + public void setSaxon(Boolean saxon) { + this.saxon = saxon; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/d10555fa/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/GzipDataFormatAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/GzipDataFormatAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/GzipDataFormatAutoConfiguration.java new file mode 100644 index 0000000..aaff31d --- /dev/null +++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/GzipDataFormatAutoConfiguration.java @@ -0,0 +1,54 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.impl.springboot; + +import java.util.HashMap; +import java.util.Map; +import org.apache.camel.CamelContext; +import org.apache.camel.CamelContextAware; +import org.apache.camel.impl.GzipDataFormat; +import org.apache.camel.util.IntrospectionSupport; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration +@EnableConfigurationProperties(GzipDataFormatConfiguration.class) +public class GzipDataFormatAutoConfiguration { + + @Bean(name = "gzip-dataformat") + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(GzipDataFormat.class) + public GzipDataFormat configureGzipDataFormat(CamelContext camelContext, + GzipDataFormatConfiguration configuration) throws Exception { + GzipDataFormat dataformat = new GzipDataFormat(); + if (dataformat instanceof CamelContextAware) { + ((CamelContextAware) dataformat).setCamelContext(camelContext); + } + Map<String, Object> parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null, + false); + IntrospectionSupport.setProperties(camelContext, + camelContext.getTypeConverter(), dataformat, parameters); + return dataformat; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/d10555fa/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/GzipDataFormatConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/GzipDataFormatConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/GzipDataFormatConfiguration.java new file mode 100644 index 0000000..df614d4 --- /dev/null +++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/GzipDataFormatConfiguration.java @@ -0,0 +1,28 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.impl.springboot; + +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * The Core Camel Java DSL based router + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.dataformat.gzip") +public class GzipDataFormatConfiguration { +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/d10555fa/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/SerializationDataFormatAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/SerializationDataFormatAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/SerializationDataFormatAutoConfiguration.java new file mode 100644 index 0000000..fbcc1a7 --- /dev/null +++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/SerializationDataFormatAutoConfiguration.java @@ -0,0 +1,56 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.impl.springboot; + +import java.util.HashMap; +import java.util.Map; +import org.apache.camel.CamelContext; +import org.apache.camel.CamelContextAware; +import org.apache.camel.impl.SerializationDataFormat; +import org.apache.camel.util.IntrospectionSupport; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration +@EnableConfigurationProperties(SerializationDataFormatConfiguration.class) +public class SerializationDataFormatAutoConfiguration { + + @Bean(name = "serialization-dataformat") + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(SerializationDataFormat.class) + public SerializationDataFormat configureSerializationDataFormat( + CamelContext camelContext, + SerializationDataFormatConfiguration configuration) + throws Exception { + SerializationDataFormat dataformat = new SerializationDataFormat(); + if (dataformat instanceof CamelContextAware) { + ((CamelContextAware) dataformat).setCamelContext(camelContext); + } + Map<String, Object> parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null, + false); + IntrospectionSupport.setProperties(camelContext, + camelContext.getTypeConverter(), dataformat, parameters); + return dataformat; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/d10555fa/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/SerializationDataFormatConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/SerializationDataFormatConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/SerializationDataFormatConfiguration.java new file mode 100644 index 0000000..ed78fab --- /dev/null +++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/SerializationDataFormatConfiguration.java @@ -0,0 +1,28 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.impl.springboot; + +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * The Core Camel Java DSL based router + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.dataformat.serialization") +public class SerializationDataFormatConfiguration { +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/d10555fa/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/StringDataFormatAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/StringDataFormatAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/StringDataFormatAutoConfiguration.java new file mode 100644 index 0000000..35daf7b --- /dev/null +++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/StringDataFormatAutoConfiguration.java @@ -0,0 +1,55 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.impl.springboot; + +import java.util.HashMap; +import java.util.Map; +import org.apache.camel.CamelContext; +import org.apache.camel.CamelContextAware; +import org.apache.camel.impl.StringDataFormat; +import org.apache.camel.util.IntrospectionSupport; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration +@EnableConfigurationProperties(StringDataFormatConfiguration.class) +public class StringDataFormatAutoConfiguration { + + @Bean(name = "string-dataformat") + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(StringDataFormat.class) + public StringDataFormat configureStringDataFormat( + CamelContext camelContext, + StringDataFormatConfiguration configuration) throws Exception { + StringDataFormat dataformat = new StringDataFormat(); + if (dataformat instanceof CamelContextAware) { + ((CamelContextAware) dataformat).setCamelContext(camelContext); + } + Map<String, Object> parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null, + false); + IntrospectionSupport.setProperties(camelContext, + camelContext.getTypeConverter(), dataformat, parameters); + return dataformat; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/d10555fa/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/StringDataFormatConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/StringDataFormatConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/StringDataFormatConfiguration.java new file mode 100644 index 0000000..575b37e --- /dev/null +++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/StringDataFormatConfiguration.java @@ -0,0 +1,42 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.impl.springboot; + +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * The Core Camel Java DSL based router + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.dataformat.string") +public class StringDataFormatConfiguration { + + /** + * Sets an encoding to use. Will by default use the JVM platform default + * charset. + */ + private String charset; + + public String getCharset() { + return charset; + } + + public void setCharset(String charset) { + this.charset = charset; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/d10555fa/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/ZipDataFormatAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/ZipDataFormatAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/ZipDataFormatAutoConfiguration.java new file mode 100644 index 0000000..bc1170d --- /dev/null +++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/ZipDataFormatAutoConfiguration.java @@ -0,0 +1,54 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.impl.springboot; + +import java.util.HashMap; +import java.util.Map; +import org.apache.camel.CamelContext; +import org.apache.camel.CamelContextAware; +import org.apache.camel.impl.ZipDataFormat; +import org.apache.camel.util.IntrospectionSupport; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration +@EnableConfigurationProperties(ZipDataFormatConfiguration.class) +public class ZipDataFormatAutoConfiguration { + + @Bean(name = "zip-dataformat") + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(ZipDataFormat.class) + public ZipDataFormat configureZipDataFormat(CamelContext camelContext, + ZipDataFormatConfiguration configuration) throws Exception { + ZipDataFormat dataformat = new ZipDataFormat(); + if (dataformat instanceof CamelContextAware) { + ((CamelContextAware) dataformat).setCamelContext(camelContext); + } + Map<String, Object> parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null, + false); + IntrospectionSupport.setProperties(camelContext, + camelContext.getTypeConverter(), dataformat, parameters); + return dataformat; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/d10555fa/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/ZipDataFormatConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/ZipDataFormatConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/ZipDataFormatConfiguration.java new file mode 100644 index 0000000..5601c25 --- /dev/null +++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/ZipDataFormatConfiguration.java @@ -0,0 +1,42 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.impl.springboot; + +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * The Core Camel Java DSL based router + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.dataformat.zip") +public class ZipDataFormatConfiguration { + + /** + * To specify a specific compression between 0-9. -1 is default compression + * 0 is no compression and 9 is best compression. + */ + private Integer compressionLevel = -1; + + public Integer getCompressionLevel() { + return compressionLevel; + } + + public void setCompressionLevel(Integer compressionLevel) { + this.compressionLevel = compressionLevel; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/d10555fa/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/bean/springboot/BeanLanguageAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/bean/springboot/BeanLanguageAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/bean/springboot/BeanLanguageAutoConfiguration.java new file mode 100644 index 0000000..d059788 --- /dev/null +++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/bean/springboot/BeanLanguageAutoConfiguration.java @@ -0,0 +1,54 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.language.bean.springboot; + +import java.util.HashMap; +import java.util.Map; +import org.apache.camel.CamelContext; +import org.apache.camel.CamelContextAware; +import org.apache.camel.language.bean.BeanLanguage; +import org.apache.camel.util.IntrospectionSupport; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration +@EnableConfigurationProperties(BeanLanguageConfiguration.class) +public class BeanLanguageAutoConfiguration { + + @Bean(name = "bean-language") + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(BeanLanguage.class) + public BeanLanguage configureBeanLanguage(CamelContext camelContext, + BeanLanguageConfiguration configuration) throws Exception { + BeanLanguage language = new BeanLanguage(); + if (language instanceof CamelContextAware) { + ((CamelContextAware) language).setCamelContext(camelContext); + } + Map<String, Object> parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null, + false); + IntrospectionSupport.setProperties(camelContext, + camelContext.getTypeConverter(), language, parameters); + return language; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/d10555fa/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/bean/springboot/BeanLanguageConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/bean/springboot/BeanLanguageConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/bean/springboot/BeanLanguageConfiguration.java new file mode 100644 index 0000000..b39a7ac --- /dev/null +++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/bean/springboot/BeanLanguageConfiguration.java @@ -0,0 +1,42 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.language.bean.springboot; + +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * For expressions and predicates using a java bean (aka method call) + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.language.bean") +public class BeanLanguageConfiguration { + + /** + * Whether to trim the value to remove leading and trailing whitespaces and + * line breaks + */ + private Boolean trim = true; + + public Boolean getTrim() { + return trim; + } + + public void setTrim(Boolean trim) { + this.trim = trim; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/d10555fa/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/constant/springboot/ConstantLanguageAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/constant/springboot/ConstantLanguageAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/constant/springboot/ConstantLanguageAutoConfiguration.java new file mode 100644 index 0000000..996c5d2 --- /dev/null +++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/constant/springboot/ConstantLanguageAutoConfiguration.java @@ -0,0 +1,55 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.language.constant.springboot; + +import java.util.HashMap; +import java.util.Map; +import org.apache.camel.CamelContext; +import org.apache.camel.CamelContextAware; +import org.apache.camel.language.constant.ConstantLanguage; +import org.apache.camel.util.IntrospectionSupport; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration +@EnableConfigurationProperties(ConstantLanguageConfiguration.class) +public class ConstantLanguageAutoConfiguration { + + @Bean(name = "constant-language") + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(ConstantLanguage.class) + public ConstantLanguage configureConstantLanguage( + CamelContext camelContext, + ConstantLanguageConfiguration configuration) throws Exception { + ConstantLanguage language = new ConstantLanguage(); + if (language instanceof CamelContextAware) { + ((CamelContextAware) language).setCamelContext(camelContext); + } + Map<String, Object> parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null, + false); + IntrospectionSupport.setProperties(camelContext, + camelContext.getTypeConverter(), language, parameters); + return language; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/d10555fa/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/constant/springboot/ConstantLanguageConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/constant/springboot/ConstantLanguageConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/constant/springboot/ConstantLanguageConfiguration.java new file mode 100644 index 0000000..cec0509 --- /dev/null +++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/constant/springboot/ConstantLanguageConfiguration.java @@ -0,0 +1,42 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.language.constant.springboot; + +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * For expressions and predicates using a constant + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.language.constant") +public class ConstantLanguageConfiguration { + + /** + * Whether to trim the value to remove leading and trailing whitespaces and + * line breaks + */ + private Boolean trim = true; + + public Boolean getTrim() { + return trim; + } + + public void setTrim(Boolean trim) { + this.trim = trim; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/d10555fa/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/header/springboot/HeaderLanguageAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/header/springboot/HeaderLanguageAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/header/springboot/HeaderLanguageAutoConfiguration.java new file mode 100644 index 0000000..93276ef --- /dev/null +++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/header/springboot/HeaderLanguageAutoConfiguration.java @@ -0,0 +1,54 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.language.header.springboot; + +import java.util.HashMap; +import java.util.Map; +import org.apache.camel.CamelContext; +import org.apache.camel.CamelContextAware; +import org.apache.camel.language.header.HeaderLanguage; +import org.apache.camel.util.IntrospectionSupport; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration +@EnableConfigurationProperties(HeaderLanguageConfiguration.class) +public class HeaderLanguageAutoConfiguration { + + @Bean(name = "header-language") + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(HeaderLanguage.class) + public HeaderLanguage configureHeaderLanguage(CamelContext camelContext, + HeaderLanguageConfiguration configuration) throws Exception { + HeaderLanguage language = new HeaderLanguage(); + if (language instanceof CamelContextAware) { + ((CamelContextAware) language).setCamelContext(camelContext); + } + Map<String, Object> parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null, + false); + IntrospectionSupport.setProperties(camelContext, + camelContext.getTypeConverter(), language, parameters); + return language; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/d10555fa/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/header/springboot/HeaderLanguageConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/header/springboot/HeaderLanguageConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/header/springboot/HeaderLanguageConfiguration.java new file mode 100644 index 0000000..bf00d3a --- /dev/null +++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/header/springboot/HeaderLanguageConfiguration.java @@ -0,0 +1,42 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.language.header.springboot; + +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * An expression which extracts the named exchange header + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.language.header") +public class HeaderLanguageConfiguration { + + /** + * Whether to trim the value to remove leading and trailing whitespaces and + * line breaks + */ + private Boolean trim = true; + + public Boolean getTrim() { + return trim; + } + + public void setTrim(Boolean trim) { + this.trim = trim; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/d10555fa/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/property/springboot/ExchangePropertyLanguageAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/property/springboot/ExchangePropertyLanguageAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/property/springboot/ExchangePropertyLanguageAutoConfiguration.java new file mode 100644 index 0000000..824866b --- /dev/null +++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/property/springboot/ExchangePropertyLanguageAutoConfiguration.java @@ -0,0 +1,56 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.language.property.springboot; + +import java.util.HashMap; +import java.util.Map; +import org.apache.camel.CamelContext; +import org.apache.camel.CamelContextAware; +import org.apache.camel.language.property.ExchangePropertyLanguage; +import org.apache.camel.util.IntrospectionSupport; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration +@EnableConfigurationProperties(ExchangePropertyLanguageConfiguration.class) +public class ExchangePropertyLanguageAutoConfiguration { + + @Bean(name = "exchangeProperty-language") + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(ExchangePropertyLanguage.class) + public ExchangePropertyLanguage configureExchangePropertyLanguage( + CamelContext camelContext, + ExchangePropertyLanguageConfiguration configuration) + throws Exception { + ExchangePropertyLanguage language = new ExchangePropertyLanguage(); + if (language instanceof CamelContextAware) { + ((CamelContextAware) language).setCamelContext(camelContext); + } + Map<String, Object> parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null, + false); + IntrospectionSupport.setProperties(camelContext, + camelContext.getTypeConverter(), language, parameters); + return language; + } +} \ No newline at end of file