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 <willem.ji...@gmail.com>
Authored: Wed Mar 25 11:38:06 2015 +0800
Committer: Willem Jiang <willem.ji...@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;
+    }
 
 }

Reply via email to