camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aka...@apache.org
Subject svn commit: r1027979 - in /camel/trunk: camel-core/src/main/java/org/apache/camel/model/ camel-core/src/main/java/org/apache/camel/model/loadbalancer/ camel-core/src/test/java/org/apache/camel/processor/ components/camel-spring/src/test/resources/org/a...
Date Wed, 27 Oct 2010 14:38:46 GMT
Author: akarpe
Date: Wed Oct 27 14:38:45 2010
New Revision: 1027979

URL: http://svn.apache.org/viewvc?rev=1027979&view=rev
Log:
CAMEL-3197 - Changed the Default Delimiter from ":" to ","

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/model/LoadBalanceDefinition.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/model/loadbalancer/WeightedLoadBalancerDefinition.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/processor/WeightedRandomLoadBalanceTest.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/processor/WeightedRoundRobinLoadBalanceTest.java
    camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/weightedRandomLoadBalance.xml
    camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/weightedRoundRobinLoadBalance.xml

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/LoadBalanceDefinition.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/LoadBalanceDefinition.java?rev=1027979&r1=1027978&r2=1027979&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/LoadBalanceDefinition.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/LoadBalanceDefinition.java
Wed Oct 27 14:38:45 2010
@@ -195,21 +195,7 @@ public class LoadBalanceDefinition exten
      * @return the builder
      */
     public LoadBalanceDefinition weighted(boolean roundRobin, String distributionRatio) {
-        WeightedLoadBalancer weighted;
-        List<Integer> distributionRatioList = new ArrayList<Integer>();
-        
-        String[] ratios = distributionRatio.split(":");
-        for (String ratio : ratios) {
-            distributionRatioList.add(new Integer(ratio));
-        }
-        
-        if (!roundRobin) {
-            weighted = new WeightedRandomLoadBalancer(distributionRatioList);
-        } else {
-            weighted = new WeightedRoundRobinLoadBalancer(distributionRatioList);
-        }
-        loadBalancerType = new LoadBalancerDefinition(weighted);
-        return this;
+        return weighted(roundRobin, distributionRatio, ",");
     }
     
     /**

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/loadbalancer/WeightedLoadBalancerDefinition.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/loadbalancer/WeightedLoadBalancerDefinition.java?rev=1027979&r1=1027978&r2=1027979&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/loadbalancer/WeightedLoadBalancerDefinition.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/loadbalancer/WeightedLoadBalancerDefinition.java
Wed Oct 27 14:38:45 2010
@@ -56,7 +56,7 @@ public class WeightedLoadBalancerDefinit
         
         try {
             if (distributionRatioDelimiter == null) {
-                distributionRatioDelimiter = ":";
+                distributionRatioDelimiter = ",";
             }
             
             String[] ratios = distributionRatio.split(distributionRatioDelimiter);

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/WeightedRandomLoadBalanceTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/WeightedRandomLoadBalanceTest.java?rev=1027979&r1=1027978&r2=1027979&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/processor/WeightedRandomLoadBalanceTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/processor/WeightedRandomLoadBalanceTest.java
Wed Oct 27 14:38:45 2010
@@ -50,7 +50,7 @@ public class WeightedRandomLoadBalanceTe
                 
                 // START SNIPPET: example
                 from("direct:start")
-                    .loadBalance().weighted(false, "4:2:1")
+                    .loadBalance().weighted(false, "4,2,1")
                         .to("mock:x", "mock:y", "mock:z");
                 // END SNIPPET: example
             }
@@ -113,7 +113,7 @@ public class WeightedRandomLoadBalanceTe
                 public void configure() {
                     // START SNIPPET: example
                     from("direct:start")
-                        .loadBalance().weighted(false, "2:3")
+                        .loadBalance().weighted(false, "2,3")
                             .to("mock:x", "mock:y", "mock:z");
                     // END SNIPPET: example
                 }

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/WeightedRoundRobinLoadBalanceTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/WeightedRoundRobinLoadBalanceTest.java?rev=1027979&r1=1027978&r2=1027979&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/processor/WeightedRoundRobinLoadBalanceTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/processor/WeightedRoundRobinLoadBalanceTest.java
Wed Oct 27 14:38:45 2010
@@ -49,7 +49,7 @@ public class WeightedRoundRobinLoadBalan
             public void configure() {
                 // START SNIPPET: example
                 from("direct:start")
-                    .loadBalance().weighted(true, "4:2:1")
+                    .loadBalance().weighted(true, "4,2,1")
                         .to("mock:x", "mock:y", "mock:z");
                 // END SNIPPET: example
             }
@@ -119,7 +119,7 @@ public class WeightedRoundRobinLoadBalan
                 public void configure() {
                     // START SNIPPET: example
                     from("direct:start")
-                        .loadBalance().weighted(true, "2:3")
+                        .loadBalance().weighted(true, "2,3")
                             .to("mock:x", "mock:y", "mock:z");
                     // END SNIPPET: example
                 }

Modified: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/weightedRandomLoadBalance.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/weightedRandomLoadBalance.xml?rev=1027979&r1=1027978&r2=1027979&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/weightedRandomLoadBalance.xml
(original)
+++ camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/weightedRandomLoadBalance.xml
Wed Oct 27 14:38:45 2010
@@ -29,7 +29,7 @@
     <route>
       <from uri="direct:start"/>
       <loadBalance>
-        <weighted roundRobin="false" distributionRatio="4, 2, 1" distributionRatioDelimiter=","
/>
+        <weighted roundRobin="false" distributionRatio="4, 2, 1" />
           <to uri="mock:x"/>
           <to uri="mock:y"/>
           <to uri="mock:z"/>

Modified: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/weightedRoundRobinLoadBalance.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/weightedRoundRobinLoadBalance.xml?rev=1027979&r1=1027978&r2=1027979&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/weightedRoundRobinLoadBalance.xml
(original)
+++ camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/weightedRoundRobinLoadBalance.xml
Wed Oct 27 14:38:45 2010
@@ -29,7 +29,7 @@
     <route>
       <from uri="direct:start"/>
       <loadBalance>
-        <weighted roundRobin="true" distributionRatio="4:2:1"/>
+        <weighted roundRobin="true" distributionRatio="4,2,1"/>
           <to uri="mock:x"/>
           <to uri="mock:y"/>
           <to uri="mock:z"/>



Mime
View raw message