You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2016/08/10 17:08:30 UTC
[6/7] camel git commit: CAMEL-9482: Generate json schema model for
camel-spring
CAMEL-9482: Generate json schema model for camel-spring
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/532371ac
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/532371ac
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/532371ac
Branch: refs/heads/master
Commit: 532371ac491fcf19bce9709acd29645af1ed0b88
Parents: 2c6d13a
Author: Claus Ibsen <da...@apache.org>
Authored: Wed Aug 10 18:08:17 2016 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Wed Aug 10 19:08:13 2016 +0200
----------------------------------------------------------------------
.../camel/core/xml/CamelJMXAgentDefinition.java | 153 +++++++++----------
.../xml/CamelPropertyPlaceholderDefinition.java | 67 +++++---
...elPropertyPlaceholderFunctionDefinition.java | 6 +
.../core/xml/CamelProxyFactoryDefinition.java | 30 +++-
.../xml/CamelServiceExporterDefinition.java | 19 ++-
.../CamelStreamCachingStrategyDefinition.java | 73 +++++++--
6 files changed, 221 insertions(+), 127 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/532371ac/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/CamelJMXAgentDefinition.java
----------------------------------------------------------------------
diff --git a/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/CamelJMXAgentDefinition.java b/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/CamelJMXAgentDefinition.java
index 861c234..e1cf54f 100644
--- a/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/CamelJMXAgentDefinition.java
+++ b/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/CamelJMXAgentDefinition.java
@@ -22,6 +22,7 @@ import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import org.apache.camel.model.IdentifiedType;
+import org.apache.camel.spi.Metadata;
import org.apache.camel.util.CollectionStringBuffer;
/**
@@ -31,112 +32,48 @@ import org.apache.camel.util.CollectionStringBuffer;
@XmlAccessorType(XmlAccessType.FIELD)
public class CamelJMXAgentDefinition extends IdentifiedType {
- /**
- * Disable JMI (default false)
- */
- @XmlAttribute
+ @XmlAttribute @Metadata(defaultValue = "false")
private String disabled;
-
- /**
- * Only register processor if a custom id was defined for it.
- */
- @XmlAttribute
+ @XmlAttribute @Metadata(defaultValue = "false")
private String onlyRegisterProcessorWithCustomId;
-
- /**
- * RMI connector registry port (default 1099)
- */
- @XmlAttribute
+ @XmlAttribute @Metadata(defaultValue = "1099")
private String registryPort;
-
- /**
- * RMI connector server port (default -1 not used)
- */
- @XmlAttribute
+ @XmlAttribute @Metadata(defaultValue = "-1")
private String connectorPort;
-
- /**
- * MBean server default domain name (default org.apache.camel)
- */
- @XmlAttribute
+ @XmlAttribute @Metadata(defaultValue = "org.apache.camel")
private String mbeanServerDefaultDomain;
-
- /**
- * MBean object domain name (default org.apache.camel)
- */
- @XmlAttribute
+ @XmlAttribute @Metadata(defaultValue = "org.apache.camel")
private String mbeanObjectDomainName;
-
- /**
- * JMX Service URL path (default /jmxrmi)
- */
- @XmlAttribute
+ @XmlAttribute @Metadata(defaultValue = "/jmxrmi")
private String serviceUrlPath;
-
- /**
- * A flag that indicates whether the agent should be created
- */
- @XmlAttribute
+ @XmlAttribute @Metadata(defaultValue = "false")
private String createConnector;
-
- /**
- * A flag that indicates whether the platform mbean server should be used
- */
- @XmlAttribute
+ @XmlAttribute @Metadata(defaultValue = "true")
private String usePlatformMBeanServer;
-
- /**
- * A flag that indicates whether to register mbeans always
- */
- @XmlAttribute
+ @XmlAttribute @Metadata(defaultValue = "false")
private String registerAlways;
-
- /**
- * A flag that indicates whether to register mbeans when starting new routes
- */
- @XmlAttribute
+ @XmlAttribute @Metadata(defaultValue = "false")
private String registerNewRoutes;
-
- /**
- * Level of granularity for performance statistics enabled
- */
- @XmlAttribute
+ @XmlAttribute @Metadata(defaultValue = "Default")
private String statisticsLevel;
-
- /**
- * A flag that indicates whether Load statistics is enabled
- */
- @XmlAttribute
+ @XmlAttribute @Metadata(defaultValue = "false")
private String loadStatisticsEnabled;
-
- /**
- * A flag that indicates whether endpoint runtime statistics is enabled
- */
- @XmlAttribute
+ @XmlAttribute @Metadata(defaultValue = "true")
private String endpointRuntimeStatisticsEnabled;
-
- /**
- * A flag that indicates whether to include hostname in JMX MBean names.
- */
- @XmlAttribute
+ @XmlAttribute @Metadata(defaultValue = "false")
private String includeHostName;
-
- /**
- * A flag that indicates whether to use hostname or IP Address in the service url.
- */
- @XmlAttribute
+ @XmlAttribute @Metadata(defaultValue = "false")
private String useHostIPAddress;
-
- /**
- * A flag that indicates whether to remove detected sensitive information (such as passwords) from MBean names and attributes.
- */
- @XmlAttribute
+ @XmlAttribute @Metadata(defaultValue = "true")
private String mask;
public String getDisabled() {
return disabled;
}
+ /**
+ * Disable JMI (default false)
+ */
public void setDisabled(String disabled) {
this.disabled = disabled;
}
@@ -145,6 +82,9 @@ public class CamelJMXAgentDefinition extends IdentifiedType {
return onlyRegisterProcessorWithCustomId;
}
+ /**
+ * Only register processor if a custom id was defined for it.
+ */
public void setOnlyRegisterProcessorWithCustomId(String onlyRegisterProcessorWithCustomId) {
this.onlyRegisterProcessorWithCustomId = onlyRegisterProcessorWithCustomId;
}
@@ -153,6 +93,9 @@ public class CamelJMXAgentDefinition extends IdentifiedType {
return registryPort;
}
+ /**
+ * RMI connector registry port (default 1099)
+ */
public void setRegistryPort(String registryPort) {
this.registryPort = registryPort;
}
@@ -161,6 +104,9 @@ public class CamelJMXAgentDefinition extends IdentifiedType {
return connectorPort;
}
+ /**
+ * RMI connector server port (default -1 not used)
+ */
public void setConnectorPort(String connectorPort) {
this.connectorPort = connectorPort;
}
@@ -169,6 +115,9 @@ public class CamelJMXAgentDefinition extends IdentifiedType {
return mbeanServerDefaultDomain;
}
+ /**
+ * MBean server default domain name (default org.apache.camel)
+ */
public void setMbeanServerDefaultDomain(String mbeanServerDefaultDomain) {
this.mbeanServerDefaultDomain = mbeanServerDefaultDomain;
}
@@ -177,6 +126,9 @@ public class CamelJMXAgentDefinition extends IdentifiedType {
return mbeanObjectDomainName;
}
+ /**
+ * MBean object domain name (default org.apache.camel)
+ */
public void setMbeanObjectDomainName(String mbeanObjectDomainName) {
this.mbeanObjectDomainName = mbeanObjectDomainName;
}
@@ -185,6 +137,9 @@ public class CamelJMXAgentDefinition extends IdentifiedType {
return serviceUrlPath;
}
+ /**
+ * JMX Service URL path (default /jmxrmi)
+ */
public void setServiceUrlPath(String serviceUrlPath) {
this.serviceUrlPath = serviceUrlPath;
}
@@ -193,6 +148,9 @@ public class CamelJMXAgentDefinition extends IdentifiedType {
return createConnector;
}
+ /**
+ * A flag that indicates whether the agent should be created
+ */
public void setCreateConnector(String createConnector) {
this.createConnector = createConnector;
}
@@ -201,6 +159,9 @@ public class CamelJMXAgentDefinition extends IdentifiedType {
return usePlatformMBeanServer;
}
+ /**
+ * A flag that indicates whether the platform mbean server should be used
+ */
public void setUsePlatformMBeanServer(String usePlatformMBeanServer) {
this.usePlatformMBeanServer = usePlatformMBeanServer;
}
@@ -209,6 +170,9 @@ public class CamelJMXAgentDefinition extends IdentifiedType {
return statisticsLevel;
}
+ /**
+ * Level of granularity for performance statistics enabled
+ */
public void setStatisticsLevel(String statisticsLevel) {
this.statisticsLevel = statisticsLevel;
}
@@ -217,6 +181,9 @@ public class CamelJMXAgentDefinition extends IdentifiedType {
return registerAlways;
}
+ /**
+ * A flag that indicates whether to register mbeans always
+ */
public void setRegisterAlways(String registerAlways) {
this.registerAlways = registerAlways;
}
@@ -225,6 +192,9 @@ public class CamelJMXAgentDefinition extends IdentifiedType {
return registerNewRoutes;
}
+ /**
+ * A flag that indicates whether to register mbeans when starting new routes
+ */
public void setRegisterNewRoutes(String registerNewRoutes) {
this.registerNewRoutes = registerNewRoutes;
}
@@ -233,6 +203,9 @@ public class CamelJMXAgentDefinition extends IdentifiedType {
return loadStatisticsEnabled;
}
+ /**
+ * A flag that indicates whether Load statistics is enabled
+ */
public void setLoadStatisticsEnabled(String loadStatisticsEnabled) {
this.loadStatisticsEnabled = loadStatisticsEnabled;
}
@@ -241,6 +214,9 @@ public class CamelJMXAgentDefinition extends IdentifiedType {
return endpointRuntimeStatisticsEnabled;
}
+ /**
+ * A flag that indicates whether endpoint runtime statistics is enabled
+ */
public void setEndpointRuntimeStatisticsEnabled(String endpointRuntimeStatisticsEnabled) {
this.endpointRuntimeStatisticsEnabled = endpointRuntimeStatisticsEnabled;
}
@@ -249,6 +225,9 @@ public class CamelJMXAgentDefinition extends IdentifiedType {
return includeHostName;
}
+ /**
+ * A flag that indicates whether to include hostname in JMX MBean names.
+ */
public void setIncludeHostName(String includeHostName) {
this.includeHostName = includeHostName;
}
@@ -257,6 +236,9 @@ public class CamelJMXAgentDefinition extends IdentifiedType {
return mask;
}
+ /**
+ * A flag that indicates whether to remove detected sensitive information (such as passwords) from MBean names and attributes.
+ */
public void setMask(String mask) {
this.mask = mask;
}
@@ -265,6 +247,9 @@ public class CamelJMXAgentDefinition extends IdentifiedType {
return useHostIPAddress;
}
+ /**
+ * A flag that indicates whether to use hostname or IP Address in the service url.
+ */
public void setUseHostIPAddress(String useHostIPAddress) {
this.useHostIPAddress = useHostIPAddress;
}
http://git-wip-us.apache.org/repos/asf/camel/blob/532371ac/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/CamelPropertyPlaceholderDefinition.java
----------------------------------------------------------------------
diff --git a/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/CamelPropertyPlaceholderDefinition.java b/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/CamelPropertyPlaceholderDefinition.java
index b07fdc0..d0802e9 100644
--- a/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/CamelPropertyPlaceholderDefinition.java
+++ b/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/CamelPropertyPlaceholderDefinition.java
@@ -24,9 +24,10 @@ import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import org.apache.camel.model.IdentifiedType;
+import org.apache.camel.spi.Metadata;
/**
- * <code>PropertyPlaceholderDefinition</code> represents a <propertyPlaceholder/> element.
+ * Properties placeholder
*
* @version
*/
@@ -36,37 +37,26 @@ public class CamelPropertyPlaceholderDefinition extends IdentifiedType {
@XmlAttribute(required = true)
private String location;
-
@XmlAttribute
private String encoding;
-
- @XmlAttribute
+ @XmlAttribute @Metadata(defaultValue = "true")
private Boolean cache;
-
- @XmlAttribute
+ @XmlAttribute @Metadata(defaultValue = "false")
private Boolean ignoreMissingLocation;
-
@XmlAttribute
private String propertiesResolverRef;
-
@XmlAttribute
private String propertiesParserRef;
-
@XmlAttribute
private String propertyPrefix;
-
@XmlAttribute
private String propertySuffix;
-
- @XmlAttribute
+ @XmlAttribute @Metadata(defaultValue = "true")
private Boolean fallbackToUnaugmentedProperty;
-
- @XmlAttribute
+ @XmlAttribute @Metadata(defaultValue = "{{")
private String prefixToken;
-
- @XmlAttribute
+ @XmlAttribute @Metadata(defaultValue = "}}")
private String suffixToken;
-
@XmlElement(name = "propertiesFunction")
private List<CamelPropertyPlaceholderFunctionDefinition> functions;
@@ -74,6 +64,10 @@ public class CamelPropertyPlaceholderDefinition extends IdentifiedType {
return location;
}
+ /**
+ * 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.
+ */
public void setLocation(String location) {
this.location = location;
}
@@ -82,6 +76,12 @@ public class CamelPropertyPlaceholderDefinition extends IdentifiedType {
return encoding;
}
+ /**
+ * Encoding to use when loading properties file from the file system or classpath.
+ * <p/>
+ * 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.Properties#load(java.io.InputStream)}
+ */
public void setEncoding(String encoding) {
this.encoding = encoding;
}
@@ -90,6 +90,9 @@ public class CamelPropertyPlaceholderDefinition extends IdentifiedType {
return cache;
}
+ /**
+ * Whether or not to cache loaded properties. The default value is true.
+ */
public void setCache(Boolean cache) {
this.cache = cache;
}
@@ -98,6 +101,9 @@ public class CamelPropertyPlaceholderDefinition extends IdentifiedType {
return propertiesResolverRef;
}
+ /**
+ * Reference to a custom PropertiesResolver to be used
+ */
public void setPropertiesResolverRef(String propertiesResolverRef) {
this.propertiesResolverRef = propertiesResolverRef;
}
@@ -106,6 +112,9 @@ public class CamelPropertyPlaceholderDefinition extends IdentifiedType {
return propertiesParserRef;
}
+ /**
+ * Reference to a custom PropertiesParser to be used
+ */
public void setPropertiesParserRef(String propertiesParserRef) {
this.propertiesParserRef = propertiesParserRef;
}
@@ -114,6 +123,9 @@ public class CamelPropertyPlaceholderDefinition extends IdentifiedType {
return propertyPrefix;
}
+ /**
+ * Optional prefix prepended to property names before resolution.
+ */
public void setPropertyPrefix(String propertyPrefix) {
this.propertyPrefix = propertyPrefix;
}
@@ -122,6 +134,9 @@ public class CamelPropertyPlaceholderDefinition extends IdentifiedType {
return propertySuffix;
}
+ /**
+ * Optional suffix appended to property names before resolution.
+ */
public void setPropertySuffix(String propertySuffix) {
this.propertySuffix = propertySuffix;
}
@@ -130,6 +145,10 @@ public class CamelPropertyPlaceholderDefinition extends IdentifiedType {
return fallbackToUnaugmentedProperty;
}
+ /**
+ * 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.
+ */
public void setFallbackToUnaugmentedProperty(Boolean fallbackToUnaugmentedProperty) {
this.fallbackToUnaugmentedProperty = fallbackToUnaugmentedProperty;
}
@@ -138,6 +157,9 @@ public class CamelPropertyPlaceholderDefinition extends IdentifiedType {
return ignoreMissingLocation;
}
+ /**
+ * Whether to silently ignore if a location cannot be located, such as a properties file not found.
+ */
public void setIgnoreMissingLocation(Boolean ignoreMissingLocation) {
this.ignoreMissingLocation = ignoreMissingLocation;
}
@@ -146,6 +168,10 @@ public class CamelPropertyPlaceholderDefinition extends IdentifiedType {
return prefixToken;
}
+ /**
+ * Sets the value of the prefix token used to identify properties to replace. Setting a value of
+ * {@code null} restores the default token {{
+ */
public void setPrefixToken(String prefixToken) {
this.prefixToken = prefixToken;
}
@@ -154,6 +180,10 @@ public class CamelPropertyPlaceholderDefinition extends IdentifiedType {
return suffixToken;
}
+ /**
+ * Sets the value of the suffix token used to identify properties to replace. Setting a value of
+ * {@code null} restores the default token }}
+ */
public void setSuffixToken(String suffixToken) {
this.suffixToken = suffixToken;
}
@@ -162,6 +192,9 @@ public class CamelPropertyPlaceholderDefinition extends IdentifiedType {
return functions;
}
+ /**
+ * List of custom properties function to use.
+ */
public void setFunctions(List<CamelPropertyPlaceholderFunctionDefinition> functions) {
this.functions = functions;
}
http://git-wip-us.apache.org/repos/asf/camel/blob/532371ac/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/CamelPropertyPlaceholderFunctionDefinition.java
----------------------------------------------------------------------
diff --git a/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/CamelPropertyPlaceholderFunctionDefinition.java b/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/CamelPropertyPlaceholderFunctionDefinition.java
index a7e328d..a3b1c19 100644
--- a/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/CamelPropertyPlaceholderFunctionDefinition.java
+++ b/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/CamelPropertyPlaceholderFunctionDefinition.java
@@ -21,6 +21,9 @@ import javax.xml.bind.annotation.XmlRootElement;
import org.apache.camel.model.IdentifiedType;
+/**
+ * Function to use with properties placeholder
+ */
@XmlRootElement(name = "propertiesFunction")
public class CamelPropertyPlaceholderFunctionDefinition extends IdentifiedType {
@@ -31,6 +34,9 @@ public class CamelPropertyPlaceholderFunctionDefinition extends IdentifiedType {
return ref;
}
+ /**
+ * Reference to the custom properties function to lookup in the registry
+ */
public void setRef(String ref) {
this.ref = ref;
}
http://git-wip-us.apache.org/repos/asf/camel/blob/532371ac/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/CamelProxyFactoryDefinition.java
----------------------------------------------------------------------
diff --git a/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/CamelProxyFactoryDefinition.java b/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/CamelProxyFactoryDefinition.java
index fa1b3a5..e0149e0 100644
--- a/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/CamelProxyFactoryDefinition.java
+++ b/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/CamelProxyFactoryDefinition.java
@@ -20,9 +20,10 @@ import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import org.apache.camel.model.IdentifiedType;
+import org.apache.camel.spi.Metadata;
/**
- * The <proxy> tag element.
+ * To proxy a service call using a interface
*
* @version
*/ // to fudge the XSD generation
@@ -31,23 +32,22 @@ public class CamelProxyFactoryDefinition extends IdentifiedType {
@XmlAttribute
private String serviceUrl;
-
- @XmlAttribute
+ @XmlAttribute @Deprecated
private String serviceRef;
-
@XmlAttribute
private Class<?> serviceInterface;
-
@XmlAttribute
private String camelContextId;
-
- @XmlAttribute
+ @XmlAttribute @Metadata(defaultValue = "true")
private Boolean binding;
public String getServiceUrl() {
return serviceUrl;
}
+ /**
+ * The camel endpoint uri used to send the message to when calling the service from the interface.
+ */
public void setServiceUrl(String serviceUrl) {
this.serviceUrl = serviceUrl;
}
@@ -56,6 +56,11 @@ public class CamelProxyFactoryDefinition extends IdentifiedType {
return serviceRef;
}
+ /**
+ * The camel endpoint reference used to send the message to when calling the service from the interface.
+ *
+ * @deprecated use serviceUrl instead with the ref endpoint.
+ */
public void setServiceRef(String serviceRef) {
this.serviceRef = serviceRef;
}
@@ -64,6 +69,9 @@ public class CamelProxyFactoryDefinition extends IdentifiedType {
return serviceInterface;
}
+ /**
+ * Java interfaces to use as facade for the service to be proxied
+ */
public void setServiceInterface(Class<?> serviceInterface) {
this.serviceInterface = serviceInterface;
}
@@ -72,6 +80,9 @@ public class CamelProxyFactoryDefinition extends IdentifiedType {
return camelContextId;
}
+ /**
+ * The id of the CamelContext to use, if there is multiple CamelContext in the same JVM.
+ */
public void setCamelContextId(String camelContextId) {
this.camelContextId = camelContextId;
}
@@ -80,6 +91,11 @@ public class CamelProxyFactoryDefinition extends IdentifiedType {
return binding;
}
+ /**
+ * Camel parameter binding is enabled by default, which will use binding information from the method signature
+ * parameters to bind to the Exchange/Message with the following annotations.
+ * If disabled then a {@link org.apache.camel.component.bean.CamelInvocationHandler} is used.
+ */
public void setBinding(Boolean binding) {
this.binding = binding;
}
http://git-wip-us.apache.org/repos/asf/camel/blob/532371ac/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/CamelServiceExporterDefinition.java
----------------------------------------------------------------------
diff --git a/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/CamelServiceExporterDefinition.java b/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/CamelServiceExporterDefinition.java
index 8986011..9c75131 100644
--- a/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/CamelServiceExporterDefinition.java
+++ b/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/CamelServiceExporterDefinition.java
@@ -22,22 +22,19 @@ import javax.xml.bind.annotation.XmlRootElement;
import org.apache.camel.model.IdentifiedType;
/**
- * The <export> tag element.
+ * Used for export a service using Spring Remoting to hide the network call using an interface.
*
* @version
*/
@XmlRootElement(name = "export")
public class CamelServiceExporterDefinition extends IdentifiedType {
- @XmlAttribute
+ @XmlAttribute(required = true)
private String uri;
-
@XmlAttribute
private String serviceRef;
-
@XmlAttribute
private Class<?> serviceInterface;
-
@XmlAttribute
private String camelContextId;
@@ -45,6 +42,9 @@ public class CamelServiceExporterDefinition extends IdentifiedType {
return uri;
}
+ /**
+ * Camel endpoint uri to use a remote transport when calling the service
+ */
public void setUri(String uri) {
this.uri = uri;
}
@@ -53,6 +53,9 @@ public class CamelServiceExporterDefinition extends IdentifiedType {
return serviceRef;
}
+ /**
+ * Reference to the service name to lookup in the registry.
+ */
public void setServiceRef(String serviceRef) {
this.serviceRef = serviceRef;
}
@@ -61,6 +64,9 @@ public class CamelServiceExporterDefinition extends IdentifiedType {
return serviceInterface;
}
+ /**
+ * Java interfaces to use as facade for the service to be exported
+ */
public void setServiceInterface(Class<?> serviceInterface) {
this.serviceInterface = serviceInterface;
}
@@ -69,6 +75,9 @@ public class CamelServiceExporterDefinition extends IdentifiedType {
return camelContextId;
}
+ /**
+ * The id of the CamelContext to use, if there is multiple CamelContext in the same JVM.
+ */
public void setCamelContextId(String camelContextId) {
this.camelContextId = camelContextId;
}
http://git-wip-us.apache.org/repos/asf/camel/blob/532371ac/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/CamelStreamCachingStrategyDefinition.java
----------------------------------------------------------------------
diff --git a/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/CamelStreamCachingStrategyDefinition.java b/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/CamelStreamCachingStrategyDefinition.java
index 6498ecc..d9a2657 100644
--- a/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/CamelStreamCachingStrategyDefinition.java
+++ b/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/CamelStreamCachingStrategyDefinition.java
@@ -22,9 +22,10 @@ import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import org.apache.camel.model.IdentifiedType;
+import org.apache.camel.spi.Metadata;
/**
- * The JAXB type class for the configuration of stream caching
+ * Stream caching configuration.
*
* @version
*/
@@ -32,43 +33,38 @@ import org.apache.camel.model.IdentifiedType;
@XmlAccessorType(XmlAccessType.FIELD)
public class CamelStreamCachingStrategyDefinition extends IdentifiedType {
- @XmlAttribute
+ @XmlAttribute @Metadata(defaultValue = "false")
private String enabled;
-
@XmlAttribute
private String spoolDirectory;
-
@XmlAttribute
private String spoolChiper;
-
@XmlAttribute
private String spoolThreshold;
-
@XmlAttribute
private String spoolUsedHeapMemoryThreshold;
-
@XmlAttribute
private String spoolUsedHeapMemoryLimit;
-
@XmlAttribute
private String spoolRules;
-
@XmlAttribute
private String bufferSize;
-
- @XmlAttribute
+ @XmlAttribute @Metadata(defaultValue = "true")
private String removeSpoolDirectoryWhenStopping;
-
@XmlAttribute
private String statisticsEnabled;
-
- @XmlAttribute
+ @XmlAttribute @Metadata(defaultValue = "false")
private String anySpoolRules;
public String getEnabled() {
return enabled;
}
+ /**
+ * Sets whether the stream caching is enabled.
+ * <p/>
+ * <b>Notice:</b> This cannot be changed at runtime.
+ */
public void setEnabled(String enabled) {
this.enabled = enabled;
}
@@ -77,6 +73,12 @@ public class CamelStreamCachingStrategyDefinition extends IdentifiedType {
return spoolDirectory;
}
+ /**
+ * Sets the spool (temporary) directory to use for overflow and spooling to disk.
+ * <p/>
+ * If no spool directory has been explicit configured, then a temporary directory
+ * is created in the <tt>java.io.tmpdir</tt> directory.
+ */
public void setSpoolDirectory(String spoolDirectory) {
this.spoolDirectory = spoolDirectory;
}
@@ -85,6 +87,11 @@ public class CamelStreamCachingStrategyDefinition extends IdentifiedType {
return spoolChiper;
}
+ /**
+ * Sets a chiper name to use when spooling to disk to write with encryption.
+ * <p/>
+ * By default the data is not encrypted.
+ */
public void setSpoolChiper(String spoolChiper) {
this.spoolChiper = spoolChiper;
}
@@ -93,6 +100,12 @@ public class CamelStreamCachingStrategyDefinition extends IdentifiedType {
return spoolThreshold;
}
+ /**
+ * Threshold in bytes when overflow to disk is activated.
+ * <p/>
+ * The default threshold is {@link org.apache.camel.StreamCache#DEFAULT_SPOOL_THRESHOLD} bytes (eg 128kb).
+ * Use <tt>-1</tt> to disable overflow to disk.
+ */
public void setSpoolThreshold(String spoolThreshold) {
this.spoolThreshold = spoolThreshold;
}
@@ -101,6 +114,9 @@ public class CamelStreamCachingStrategyDefinition extends IdentifiedType {
return spoolUsedHeapMemoryThreshold;
}
+ /**
+ * Sets a percentage (1-99) of used heap memory threshold to activate spooling to disk.
+ */
public void setSpoolUsedHeapMemoryThreshold(String spoolUsedHeapMemoryThreshold) {
this.spoolUsedHeapMemoryThreshold = spoolUsedHeapMemoryThreshold;
}
@@ -109,6 +125,10 @@ public class CamelStreamCachingStrategyDefinition extends IdentifiedType {
return spoolUsedHeapMemoryLimit;
}
+ /**
+ * Sets what the upper bounds should be when spoolUsedHeapMemoryThreshold
+ * is in use.
+ */
public void setSpoolUsedHeapMemoryLimit(String spoolUsedHeapMemoryLimit) {
this.spoolUsedHeapMemoryLimit = spoolUsedHeapMemoryLimit;
}
@@ -117,6 +137,10 @@ public class CamelStreamCachingStrategyDefinition extends IdentifiedType {
return spoolRules;
}
+ /**
+ * Reference to one or more custom {@link org.apache.camel.spi.StreamCachingStrategy.SpoolRule} to use.
+ * Multiple rules can be separated by comma.
+ */
public void setSpoolRules(String spoolRules) {
this.spoolRules = spoolRules;
}
@@ -125,6 +149,11 @@ public class CamelStreamCachingStrategyDefinition extends IdentifiedType {
return bufferSize;
}
+ /**
+ * Sets the buffer size to use when allocating in-memory buffers used for in-memory stream caches.
+ * <p/>
+ * The default size is {@link org.apache.camel.util.IOHelper#DEFAULT_BUFFER_SIZE}
+ */
public void setBufferSize(String bufferSize) {
this.bufferSize = bufferSize;
}
@@ -133,6 +162,11 @@ public class CamelStreamCachingStrategyDefinition extends IdentifiedType {
return removeSpoolDirectoryWhenStopping;
}
+ /**
+ * Whether to remove the temporary directory when stopping.
+ * <p/>
+ * This option is default <tt>true</tt>
+ */
public void setRemoveSpoolDirectoryWhenStopping(String removeSpoolDirectoryWhenStopping) {
this.removeSpoolDirectoryWhenStopping = removeSpoolDirectoryWhenStopping;
}
@@ -141,6 +175,9 @@ public class CamelStreamCachingStrategyDefinition extends IdentifiedType {
return statisticsEnabled;
}
+ /**
+ * Sets whether statistics is enabled.
+ */
public void setStatisticsEnabled(String statisticsEnabled) {
this.statisticsEnabled = statisticsEnabled;
}
@@ -149,6 +186,14 @@ public class CamelStreamCachingStrategyDefinition extends IdentifiedType {
return anySpoolRules;
}
+ /**
+ * Sets whether if just any of the {@link org.apache.camel.spi.StreamCachingStrategy.SpoolRule} rules
+ * returns <tt>true</tt> then shouldSpoolCache(long) returns <tt>true</tt>.
+ * If this option is <tt>false</tt>, then <b>all</b> the {@link org.apache.camel.spi.StreamCachingStrategy.SpoolRule} must
+ * return <tt>true</tt>.
+ * <p/>
+ * The default value is <tt>false</tt> which means that all the rules must return <tt>true</tt>.
+ */
public void setAnySpoolRules(String anySpoolRules) {
this.anySpoolRules = anySpoolRules;
}