You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2015/03/25 04:44:33 UTC

[1/2] camel git commit: CAMEL-8544 Dynamic router - unsupported cacheSize attribute

Repository: camel
Updated Branches:
  refs/heads/camel-2.14.x cc787d651 -> eb0feec45
  refs/heads/camel-2.15.x 368d78ffe -> 38beadc19


CAMEL-8544 Dynamic router - unsupported cacheSize attribute


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/eb0feec4
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/eb0feec4
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/eb0feec4

Branch: refs/heads/camel-2.14.x
Commit: eb0feec45e8a0b798b78bf8e94a8f41a31e8908a
Parents: cc787d6
Author: Willem Jiang <wi...@gmail.com>
Authored: Wed Mar 25 11:38:06 2015 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Wed Mar 25 11:43:16 2015 +0800

----------------------------------------------------------------------
 .../camel/model/DynamicRouterDefinition.java    | 25 ++++++++++++++++++++
 1 file changed, 25 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/eb0feec4/camel-core/src/main/java/org/apache/camel/model/DynamicRouterDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/DynamicRouterDefinition.java b/camel-core/src/main/java/org/apache/camel/model/DynamicRouterDefinition.java
index 9a486fb..f82b959 100644
--- a/camel-core/src/main/java/org/apache/camel/model/DynamicRouterDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/DynamicRouterDefinition.java
@@ -41,6 +41,8 @@ public class DynamicRouterDefinition<Type extends ProcessorDefinition<Type>> ext
     private String uriDelimiter;
     @XmlAttribute
     private Boolean ignoreInvalidEndpoints;
+    @XmlAttribute
+    private Integer cacheSize; 
 
     public DynamicRouterDefinition() {
     }
@@ -78,6 +80,9 @@ public class DynamicRouterDefinition<Type extends ProcessorDefinition<Type>> ext
         if (getIgnoreInvalidEndpoints() != null) {
             dynamicRouter.setIgnoreInvalidEndpoints(getIgnoreInvalidEndpoints());
         }
+        if (getCacheSize() != null) {
+            dynamicRouter.setCacheSize(getCacheSize());
+        }
         return dynamicRouter;
     }
 
@@ -100,6 +105,14 @@ public class DynamicRouterDefinition<Type extends ProcessorDefinition<Type>> ext
     // Fluent API
     // -------------------------------------------------------------------------
 
+    public Integer getCacheSize() {
+        return cacheSize;
+    }
+
+    public void setCacheSize(Integer cacheSize) {
+        this.cacheSize = cacheSize;
+    }
+
     @Override
     @SuppressWarnings("unchecked")
     public Type end() {
@@ -127,5 +140,17 @@ public class DynamicRouterDefinition<Type extends ProcessorDefinition<Type>> ext
         setUriDelimiter(uriDelimiter);
         return this;
     }
+    
+    /**
+     * Sets the maximum size used by the {@link org.apache.camel.impl.ProducerCache} which is used
+     * to cache and reuse producers when using this recipient list, when uris are reused.
+     *
+     * @param cacheSize  the cache size, use <tt>0</tt> for default cache size, or <tt>-1</tt> to turn cache off.
+     * @return the builder
+     */
+    public DynamicRouterDefinition<Type> cacheSize(int cacheSize) {
+        setCacheSize(cacheSize);
+        return this;
+    }
 
 }


[2/2] camel git commit: CAMEL-8544 Dynamic router - unsupported cacheSize attribute

Posted by ni...@apache.org.
CAMEL-8544 Dynamic router - unsupported cacheSize attribute


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/38beadc1
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/38beadc1
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/38beadc1

Branch: refs/heads/camel-2.15.x
Commit: 38beadc19518f058fab2aa68a6cbc3fbd1473234
Parents: 368d78f
Author: Willem Jiang <wi...@gmail.com>
Authored: Wed Mar 25 11:38:06 2015 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Wed Mar 25 11:43:38 2015 +0800

----------------------------------------------------------------------
 .../camel/model/DynamicRouterDefinition.java    | 25 ++++++++++++++++++++
 1 file changed, 25 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/38beadc1/camel-core/src/main/java/org/apache/camel/model/DynamicRouterDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/DynamicRouterDefinition.java b/camel-core/src/main/java/org/apache/camel/model/DynamicRouterDefinition.java
index cf5899d..9d39830 100644
--- a/camel-core/src/main/java/org/apache/camel/model/DynamicRouterDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/DynamicRouterDefinition.java
@@ -44,6 +44,8 @@ public class DynamicRouterDefinition<Type extends ProcessorDefinition<Type>> ext
     private String uriDelimiter;
     @XmlAttribute
     private Boolean ignoreInvalidEndpoints;
+    @XmlAttribute
+    private Integer cacheSize; 
 
     public DynamicRouterDefinition() {
     }
@@ -76,6 +78,9 @@ public class DynamicRouterDefinition<Type extends ProcessorDefinition<Type>> ext
         if (getIgnoreInvalidEndpoints() != null) {
             dynamicRouter.setIgnoreInvalidEndpoints(getIgnoreInvalidEndpoints());
         }
+        if (getCacheSize() != null) {
+            dynamicRouter.setCacheSize(getCacheSize());
+        }
         return dynamicRouter;
     }
 
@@ -110,6 +115,14 @@ public class DynamicRouterDefinition<Type extends ProcessorDefinition<Type>> ext
     // Fluent API
     // -------------------------------------------------------------------------
 
+    public Integer getCacheSize() {
+        return cacheSize;
+    }
+
+    public void setCacheSize(Integer cacheSize) {
+        this.cacheSize = cacheSize;
+    }
+
     @Override
     @SuppressWarnings("unchecked")
     public Type end() {
@@ -137,5 +150,17 @@ public class DynamicRouterDefinition<Type extends ProcessorDefinition<Type>> ext
         setUriDelimiter(uriDelimiter);
         return this;
     }
+    
+    /**
+     * Sets the maximum size used by the {@link org.apache.camel.impl.ProducerCache} which is used
+     * to cache and reuse producers when using this recipient list, when uris are reused.
+     *
+     * @param cacheSize  the cache size, use <tt>0</tt> for default cache size, or <tt>-1</tt> to turn cache off.
+     * @return the builder
+     */
+    public DynamicRouterDefinition<Type> cacheSize(int cacheSize) {
+        setCacheSize(cacheSize);
+        return this;
+    }
 
 }