Repository: camel Updated Branches: refs/heads/boot-generate 4b7844732 -> f1402a7eb
Experiment with generating spring-boot auto configuration for the Camel components. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/f1402a7e Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/f1402a7e Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/f1402a7e Branch: refs/heads/boot-generate Commit: f1402a7ebcd3287add59614aed13734078b6dc32 Parents: 4b78447 Author: Claus Ibsen <davscl...@apache.org> Authored: Wed Jun 8 12:50:18 2016 +0200 Committer: Claus Ibsen <davscl...@apache.org> Committed: Wed Jun 8 12:50:18 2016 +0200 ---------------------------------------------------------------------- camel-core/pom.xml | 23 ++ .../DirectComponentAutoConfiguration.java | 50 ++++ .../DirectComponentConfiguration.java | 56 +++++ .../DirectVmComponentAutoConfiguration.java | 50 ++++ .../DirectVmComponentConfiguration.java | 85 +++++++ .../LogComponentAutoConfiguration.java | 50 ++++ .../springboot/LogComponentConfiguration.java | 44 ++++ .../PropertiesComponentAutoConfiguration.java | 50 ++++ .../PropertiesComponentConfiguration.java | 230 +++++++++++++++++++ .../SchedulerComponentAutoConfiguration.java | 50 ++++ .../SchedulerComponentConfiguration.java | 43 ++++ .../SedaComponentAutoConfiguration.java | 50 ++++ .../springboot/SedaComponentConfiguration.java | 70 ++++++ .../StubComponentAutoConfiguration.java | 50 ++++ .../springboot/StubComponentConfiguration.java | 70 ++++++ .../ValidatorComponentAutoConfiguration.java | 50 ++++ .../ValidatorComponentConfiguration.java | 44 ++++ .../VmComponentAutoConfiguration.java | 50 ++++ .../vm/springboot/VmComponentConfiguration.java | 70 ++++++ .../XsltComponentAutoConfiguration.java | 50 ++++ .../springboot/XsltComponentConfiguration.java | 104 +++++++++ .../main/resources/META-INF/spring.factories | 35 +++ 22 files changed, 1374 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/f1402a7e/camel-core/pom.xml ---------------------------------------------------------------------- diff --git a/camel-core/pom.xml b/camel-core/pom.xml index ca2ac54..6f999e3 100644 --- a/camel-core/pom.xml +++ b/camel-core/pom.xml @@ -355,6 +355,7 @@ <id>validate</id> <goals> <goal>validate-components</goal> + <goal>prepare-spring-boot-auto-configuration</goal> </goals> <phase>prepare-package</phase> </execution> @@ -534,12 +535,34 @@ </activation> <dependencies> + + <!-- to support spring-boot auto configuration in the Camel components --> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot</artifactId> + <version>${spring-boot-version}</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-autoconfigure</artifactId> + <version>${spring-boot-version}</version> + <scope>provided</scope> + </dependency> + <!-- enable the APT processor --> <dependency> <groupId>org.apache.camel</groupId> <artifactId>apt</artifactId> <scope>provided</scope> </dependency> + <!-- enable Spring Boot configuration APT processor --> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-configuration-processor</artifactId> + <version>${spring-boot-version}</version> + <scope>provided</scope> + </dependency> </dependencies> </profile> http://git-wip-us.apache.org/repos/asf/camel/blob/f1402a7e/camel-core/src/main/java/org/apache/camel/component/direct/springboot/DirectComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/component/direct/springboot/DirectComponentAutoConfiguration.java b/camel-core/src/main/java/org/apache/camel/component/direct/springboot/DirectComponentAutoConfiguration.java new file mode 100644 index 0000000..675fefa --- /dev/null +++ b/camel-core/src/main/java/org/apache/camel/component/direct/springboot/DirectComponentAutoConfiguration.java @@ -0,0 +1,50 @@ +/** + * 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.direct.springboot; + +import java.util.HashMap; +import java.util.Map; +import org.apache.camel.CamelContext; +import org.apache.camel.component.direct.DirectComponent; +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(DirectComponentConfiguration.class) +public class DirectComponentAutoConfiguration { + + @Bean + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(DirectComponent.class) + public DirectComponent configureComponent(CamelContext camelContext, + DirectComponentConfiguration configuration) throws Exception { + DirectComponent component = new DirectComponent(); + component.setCamelContext(camelContext); + Map<String, Object> parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null); + 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/f1402a7e/camel-core/src/main/java/org/apache/camel/component/direct/springboot/DirectComponentConfiguration.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/component/direct/springboot/DirectComponentConfiguration.java b/camel-core/src/main/java/org/apache/camel/component/direct/springboot/DirectComponentConfiguration.java new file mode 100644 index 0000000..848e762 --- /dev/null +++ b/camel-core/src/main/java/org/apache/camel/component/direct/springboot/DirectComponentConfiguration.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.component.direct.springboot; + +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * The direct component provides direct synchronous call to another endpoint + * from the same CamelContext. + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.component.direct") +public class DirectComponentConfiguration { + + /** + * If sending a message to a direct endpoint which has no active consumer + * then we can tell the producer to block and wait for the consumer to + * become active. + */ + private boolean block; + /** + * The timeout value to use if block is enabled. + */ + private long timeout; + + public boolean isBlock() { + return block; + } + + public void setBlock(boolean block) { + this.block = block; + } + + public long getTimeout() { + return timeout; + } + + public void setTimeout(long timeout) { + this.timeout = timeout; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/f1402a7e/camel-core/src/main/java/org/apache/camel/component/directvm/springboot/DirectVmComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/component/directvm/springboot/DirectVmComponentAutoConfiguration.java b/camel-core/src/main/java/org/apache/camel/component/directvm/springboot/DirectVmComponentAutoConfiguration.java new file mode 100644 index 0000000..97c9f1a --- /dev/null +++ b/camel-core/src/main/java/org/apache/camel/component/directvm/springboot/DirectVmComponentAutoConfiguration.java @@ -0,0 +1,50 @@ +/** + * 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.directvm.springboot; + +import java.util.HashMap; +import java.util.Map; +import org.apache.camel.CamelContext; +import org.apache.camel.component.directvm.DirectVmComponent; +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(DirectVmComponentConfiguration.class) +public class DirectVmComponentAutoConfiguration { + + @Bean + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(DirectVmComponent.class) + public DirectVmComponent configureComponent(CamelContext camelContext, + DirectVmComponentConfiguration configuration) throws Exception { + DirectVmComponent component = new DirectVmComponent(); + component.setCamelContext(camelContext); + Map<String, Object> parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null); + 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/f1402a7e/camel-core/src/main/java/org/apache/camel/component/directvm/springboot/DirectVmComponentConfiguration.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/component/directvm/springboot/DirectVmComponentConfiguration.java b/camel-core/src/main/java/org/apache/camel/component/directvm/springboot/DirectVmComponentConfiguration.java new file mode 100644 index 0000000..b336e8a --- /dev/null +++ b/camel-core/src/main/java/org/apache/camel/component/directvm/springboot/DirectVmComponentConfiguration.java @@ -0,0 +1,85 @@ +/** + * 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.directvm.springboot; + +import org.apache.camel.spi.HeaderFilterStrategy; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * The direct-vm component provides direct synchronous 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.direct-vm") +public class DirectVmComponentConfiguration { + + /** + * If sending a message to a direct endpoint which has no active consumer + * then we can tell the producer to block and wait for the consumer to + * become active. + */ + private boolean block; + /** + * The timeout value to use if block is enabled. + */ + private long timeout; + /** + * Sets a HeaderFilterStrategy that will only be applied on producer + * endpoints (on both directions: request and response). Default value: + * none. + */ + private HeaderFilterStrategy headerFilterStrategy; + /** + * Whether to propagate or not properties from the producer side to the + * consumer side and viceversa. Default value: true. + */ + private boolean propagateProperties; + + public boolean isBlock() { + return block; + } + + public void setBlock(boolean block) { + this.block = block; + } + + public long getTimeout() { + return timeout; + } + + public void setTimeout(long timeout) { + this.timeout = timeout; + } + + public HeaderFilterStrategy getHeaderFilterStrategy() { + return headerFilterStrategy; + } + + public void setHeaderFilterStrategy( + HeaderFilterStrategy headerFilterStrategy) { + this.headerFilterStrategy = headerFilterStrategy; + } + + public boolean isPropagateProperties() { + return propagateProperties; + } + + public void setPropagateProperties(boolean propagateProperties) { + this.propagateProperties = propagateProperties; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/f1402a7e/camel-core/src/main/java/org/apache/camel/component/log/springboot/LogComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/component/log/springboot/LogComponentAutoConfiguration.java b/camel-core/src/main/java/org/apache/camel/component/log/springboot/LogComponentAutoConfiguration.java new file mode 100644 index 0000000..b6fb50b --- /dev/null +++ b/camel-core/src/main/java/org/apache/camel/component/log/springboot/LogComponentAutoConfiguration.java @@ -0,0 +1,50 @@ +/** + * 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.log.springboot; + +import java.util.HashMap; +import java.util.Map; +import org.apache.camel.CamelContext; +import org.apache.camel.component.log.LogComponent; +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(LogComponentConfiguration.class) +public class LogComponentAutoConfiguration { + + @Bean + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(LogComponent.class) + public LogComponent configureComponent(CamelContext camelContext, + LogComponentConfiguration configuration) throws Exception { + LogComponent component = new LogComponent(); + component.setCamelContext(camelContext); + Map<String, Object> parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null); + 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/f1402a7e/camel-core/src/main/java/org/apache/camel/component/log/springboot/LogComponentConfiguration.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/component/log/springboot/LogComponentConfiguration.java b/camel-core/src/main/java/org/apache/camel/component/log/springboot/LogComponentConfiguration.java new file mode 100644 index 0000000..8b40ee6 --- /dev/null +++ b/camel-core/src/main/java/org/apache/camel/component/log/springboot/LogComponentConfiguration.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.log.springboot; + +import org.apache.camel.spi.ExchangeFormatter; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * The log component logs message exchanges to the underlying logging mechanism. + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.component.log") +public class LogComponentConfiguration { + + /** + * Sets a custom ExchangeFormatter to convert the Exchange to a String + * suitable for logging. If not specified we default to + * DefaultExchangeFormatter. + */ + private ExchangeFormatter exchangeFormatter; + + public ExchangeFormatter getExchangeFormatter() { + return exchangeFormatter; + } + + public void setExchangeFormatter(ExchangeFormatter exchangeFormatter) { + this.exchangeFormatter = exchangeFormatter; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/f1402a7e/camel-core/src/main/java/org/apache/camel/component/properties/springboot/PropertiesComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/component/properties/springboot/PropertiesComponentAutoConfiguration.java b/camel-core/src/main/java/org/apache/camel/component/properties/springboot/PropertiesComponentAutoConfiguration.java new file mode 100644 index 0000000..86de648 --- /dev/null +++ b/camel-core/src/main/java/org/apache/camel/component/properties/springboot/PropertiesComponentAutoConfiguration.java @@ -0,0 +1,50 @@ +/** + * 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.HashMap; +import java.util.Map; +import org.apache.camel.CamelContext; +import org.apache.camel.component.properties.PropertiesComponent; +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(PropertiesComponentConfiguration.class) +public class PropertiesComponentAutoConfiguration { + + @Bean + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(PropertiesComponent.class) + public PropertiesComponent configureComponent(CamelContext camelContext, + PropertiesComponentConfiguration configuration) throws Exception { + PropertiesComponent component = new PropertiesComponent(); + component.setCamelContext(camelContext); + Map<String, Object> parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null); + 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/f1402a7e/camel-core/src/main/java/org/apache/camel/component/properties/springboot/PropertiesComponentConfiguration.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/component/properties/springboot/PropertiesComponentConfiguration.java b/camel-core/src/main/java/org/apache/camel/component/properties/springboot/PropertiesComponentConfiguration.java new file mode 100644 index 0000000..2d31111 --- /dev/null +++ b/camel-core/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 int 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 isCache() { + 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 isFallbackToUnaugmentedProperty() { + return fallbackToUnaugmentedProperty; + } + + public void setFallbackToUnaugmentedProperty( + boolean fallbackToUnaugmentedProperty) { + this.fallbackToUnaugmentedProperty = fallbackToUnaugmentedProperty; + } + + public boolean isIgnoreMissingLocation() { + 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 int getSystemPropertiesMode() { + return systemPropertiesMode; + } + + public void setSystemPropertiesMode(int systemPropertiesMode) { + this.systemPropertiesMode = systemPropertiesMode; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/f1402a7e/camel-core/src/main/java/org/apache/camel/component/scheduler/springboot/SchedulerComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/component/scheduler/springboot/SchedulerComponentAutoConfiguration.java b/camel-core/src/main/java/org/apache/camel/component/scheduler/springboot/SchedulerComponentAutoConfiguration.java new file mode 100644 index 0000000..e5e3800 --- /dev/null +++ b/camel-core/src/main/java/org/apache/camel/component/scheduler/springboot/SchedulerComponentAutoConfiguration.java @@ -0,0 +1,50 @@ +/** + * 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 + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(SchedulerComponent.class) + public SchedulerComponent configureComponent(CamelContext camelContext, + SchedulerComponentConfiguration configuration) throws Exception { + SchedulerComponent component = new SchedulerComponent(); + component.setCamelContext(camelContext); + Map<String, Object> parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null); + 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/f1402a7e/camel-core/src/main/java/org/apache/camel/component/scheduler/springboot/SchedulerComponentConfiguration.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/component/scheduler/springboot/SchedulerComponentConfiguration.java b/camel-core/src/main/java/org/apache/camel/component/scheduler/springboot/SchedulerComponentConfiguration.java new file mode 100644 index 0000000..a4c7e6f --- /dev/null +++ b/camel-core/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 int concurrentTasks; + + public int getConcurrentTasks() { + return concurrentTasks; + } + + public void setConcurrentTasks(int concurrentTasks) { + this.concurrentTasks = concurrentTasks; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/f1402a7e/camel-core/src/main/java/org/apache/camel/component/seda/springboot/SedaComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/component/seda/springboot/SedaComponentAutoConfiguration.java b/camel-core/src/main/java/org/apache/camel/component/seda/springboot/SedaComponentAutoConfiguration.java new file mode 100644 index 0000000..009b1ea --- /dev/null +++ b/camel-core/src/main/java/org/apache/camel/component/seda/springboot/SedaComponentAutoConfiguration.java @@ -0,0 +1,50 @@ +/** + * 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 + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(SedaComponent.class) + public SedaComponent configureComponent(CamelContext camelContext, + SedaComponentConfiguration configuration) throws Exception { + SedaComponent component = new SedaComponent(); + component.setCamelContext(camelContext); + Map<String, Object> parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null); + 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/f1402a7e/camel-core/src/main/java/org/apache/camel/component/seda/springboot/SedaComponentConfiguration.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/component/seda/springboot/SedaComponentConfiguration.java b/camel-core/src/main/java/org/apache/camel/component/seda/springboot/SedaComponentConfiguration.java new file mode 100644 index 0000000..1f4ec64 --- /dev/null +++ b/camel-core/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 int queueSize; + /** + * Sets the default number of concurrent threads processing exchanges. + */ + private int concurrentConsumers; + /** + * Sets the default queue factory. + */ + private BlockingQueueFactory<org.apache.camel.Exchange> defaultQueueFactory; + + public int getQueueSize() { + return queueSize; + } + + public void setQueueSize(int queueSize) { + this.queueSize = queueSize; + } + + public int getConcurrentConsumers() { + return concurrentConsumers; + } + + public void setConcurrentConsumers(int 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/f1402a7e/camel-core/src/main/java/org/apache/camel/component/stub/springboot/StubComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/component/stub/springboot/StubComponentAutoConfiguration.java b/camel-core/src/main/java/org/apache/camel/component/stub/springboot/StubComponentAutoConfiguration.java new file mode 100644 index 0000000..b49ac9c --- /dev/null +++ b/camel-core/src/main/java/org/apache/camel/component/stub/springboot/StubComponentAutoConfiguration.java @@ -0,0 +1,50 @@ +/** + * 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 + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(StubComponent.class) + public StubComponent configureComponent(CamelContext camelContext, + StubComponentConfiguration configuration) throws Exception { + StubComponent component = new StubComponent(); + component.setCamelContext(camelContext); + Map<String, Object> parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null); + 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/f1402a7e/camel-core/src/main/java/org/apache/camel/component/stub/springboot/StubComponentConfiguration.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/component/stub/springboot/StubComponentConfiguration.java b/camel-core/src/main/java/org/apache/camel/component/stub/springboot/StubComponentConfiguration.java new file mode 100644 index 0000000..f40268c --- /dev/null +++ b/camel-core/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 int queueSize; + /** + * Sets the default number of concurrent threads processing exchanges. + */ + private int concurrentConsumers; + /** + * Sets the default queue factory. + */ + private BlockingQueueFactory<org.apache.camel.Exchange> defaultQueueFactory; + + public int getQueueSize() { + return queueSize; + } + + public void setQueueSize(int queueSize) { + this.queueSize = queueSize; + } + + public int getConcurrentConsumers() { + return concurrentConsumers; + } + + public void setConcurrentConsumers(int 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/f1402a7e/camel-core/src/main/java/org/apache/camel/component/validator/springboot/ValidatorComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/component/validator/springboot/ValidatorComponentAutoConfiguration.java b/camel-core/src/main/java/org/apache/camel/component/validator/springboot/ValidatorComponentAutoConfiguration.java new file mode 100644 index 0000000..9f14137 --- /dev/null +++ b/camel-core/src/main/java/org/apache/camel/component/validator/springboot/ValidatorComponentAutoConfiguration.java @@ -0,0 +1,50 @@ +/** + * 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 + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(ValidatorComponent.class) + public ValidatorComponent configureComponent(CamelContext camelContext, + ValidatorComponentConfiguration configuration) throws Exception { + ValidatorComponent component = new ValidatorComponent(); + component.setCamelContext(camelContext); + Map<String, Object> parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null); + 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/f1402a7e/camel-core/src/main/java/org/apache/camel/component/validator/springboot/ValidatorComponentConfiguration.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/component/validator/springboot/ValidatorComponentConfiguration.java b/camel-core/src/main/java/org/apache/camel/component/validator/springboot/ValidatorComponentConfiguration.java new file mode 100644 index 0000000..40e5a2d --- /dev/null +++ b/camel-core/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/f1402a7e/camel-core/src/main/java/org/apache/camel/component/vm/springboot/VmComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/component/vm/springboot/VmComponentAutoConfiguration.java b/camel-core/src/main/java/org/apache/camel/component/vm/springboot/VmComponentAutoConfiguration.java new file mode 100644 index 0000000..49747e1 --- /dev/null +++ b/camel-core/src/main/java/org/apache/camel/component/vm/springboot/VmComponentAutoConfiguration.java @@ -0,0 +1,50 @@ +/** + * 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 + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(VmComponent.class) + public VmComponent configureComponent(CamelContext camelContext, + VmComponentConfiguration configuration) throws Exception { + VmComponent component = new VmComponent(); + component.setCamelContext(camelContext); + Map<String, Object> parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null); + 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/f1402a7e/camel-core/src/main/java/org/apache/camel/component/vm/springboot/VmComponentConfiguration.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/component/vm/springboot/VmComponentConfiguration.java b/camel-core/src/main/java/org/apache/camel/component/vm/springboot/VmComponentConfiguration.java new file mode 100644 index 0000000..106cf89 --- /dev/null +++ b/camel-core/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 int queueSize; + /** + * Sets the default number of concurrent threads processing exchanges. + */ + private int concurrentConsumers; + /** + * Sets the default queue factory. + */ + private BlockingQueueFactory<org.apache.camel.Exchange> defaultQueueFactory; + + public int getQueueSize() { + return queueSize; + } + + public void setQueueSize(int queueSize) { + this.queueSize = queueSize; + } + + public int getConcurrentConsumers() { + return concurrentConsumers; + } + + public void setConcurrentConsumers(int 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/f1402a7e/camel-core/src/main/java/org/apache/camel/component/xslt/springboot/XsltComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/component/xslt/springboot/XsltComponentAutoConfiguration.java b/camel-core/src/main/java/org/apache/camel/component/xslt/springboot/XsltComponentAutoConfiguration.java new file mode 100644 index 0000000..3d3fdf8 --- /dev/null +++ b/camel-core/src/main/java/org/apache/camel/component/xslt/springboot/XsltComponentAutoConfiguration.java @@ -0,0 +1,50 @@ +/** + * 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 + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(XsltComponent.class) + public XsltComponent configureComponent(CamelContext camelContext, + XsltComponentConfiguration configuration) throws Exception { + XsltComponent component = new XsltComponent(); + component.setCamelContext(camelContext); + Map<String, Object> parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null); + 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/f1402a7e/camel-core/src/main/java/org/apache/camel/component/xslt/springboot/XsltComponentConfiguration.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/component/xslt/springboot/XsltComponentConfiguration.java b/camel-core/src/main/java/org/apache/camel/component/xslt/springboot/XsltComponentConfiguration.java new file mode 100644 index 0000000..b4f3be8 --- /dev/null +++ b/camel-core/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; + /** + * 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 isContentCache() { + return contentCache; + } + + public void setContentCache(boolean contentCache) { + this.contentCache = contentCache; + } + + public boolean isSaxon() { + 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/f1402a7e/camel-core/src/main/resources/META-INF/spring.factories ---------------------------------------------------------------------- diff --git a/camel-core/src/main/resources/META-INF/spring.factories b/camel-core/src/main/resources/META-INF/spring.factories new file mode 100644 index 0000000..b96c2d2 --- /dev/null +++ b/camel-core/src/main/resources/META-INF/spring.factories @@ -0,0 +1,35 @@ +# +# 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. +# + +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ +org.apache.camel.component.direct.springboot.DirectComponentAutoConfiguration,\ +org.apache.camel.component.directvm.springboot.DirectVmComponentAutoConfiguration,\ +org.apache.camel.component.log.springboot.LogComponentAutoConfiguration,\ +org.apache.camel.component.properties.springboot.PropertiesComponentAutoConfiguration,\ +org.apache.camel.component.scheduler.springboot.SchedulerComponentAutoConfiguration,\ +org.apache.camel.component.seda.springboot.SedaComponentAutoConfiguration,\ +org.apache.camel.component.stub.springboot.StubComponentAutoConfiguration,\ +org.apache.camel.component.validator.springboot.ValidatorComponentAutoConfiguration,\ +org.apache.camel.component.xslt.springboot.XsltComponentAutoConfiguration + + + + + + + +