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 2014/07/02 21:01:32 UTC

[1/3] git commit: CAMEL-7504: Have a ThrottlerRejectedExecutionException instead of a generic RejectedExecutionException

Repository: camel
Updated Branches:
  refs/heads/master 61839f228 -> 76ddb85f5


CAMEL-7504: Have a ThrottlerRejectedExecutionException instead of a generic RejectedExecutionException


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

Branch: refs/heads/master
Commit: e7eddb02286cd8f147324462d6e15b8f09dec1df
Parents: 9d661ab
Author: david <da...@davidkarlsen.com>
Authored: Wed Jul 2 20:29:59 2014 +0200
Committer: david <da...@davidkarlsen.com>
Committed: Wed Jul 2 20:29:59 2014 +0200

----------------------------------------------------------------------
 .../org/apache/camel/model/ThrottleDefinition.java  |  2 +-
 .../java/org/apache/camel/processor/Throttler.java  | 16 +++++-----------
 .../ThrottlerRejectedExecutionException.java        | 15 +++++++++++++++
 .../org/apache/camel/processor/ThrottlerTest.java   | 10 +++++-----
 .../org/apache/camel/spring/processor/throttler.xml |  2 +-
 5 files changed, 27 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/e7eddb02/camel-core/src/main/java/org/apache/camel/model/ThrottleDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/ThrottleDefinition.java b/camel-core/src/main/java/org/apache/camel/model/ThrottleDefinition.java
index b829052..9ec13f8 100644
--- a/camel-core/src/main/java/org/apache/camel/model/ThrottleDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/ThrottleDefinition.java
@@ -168,7 +168,7 @@ public class ThrottleDefinition extends ExpressionNode implements ExecutorServic
     }
     
     /**
-     * Whether or not throttler throws the RejectExceutionException when the exchange exceeds the request limit
+     * Whether or not throttler throws the ThrottlerRejectedExecutionException when the exchange exceeds the request limit
      * <p/>
      * Is by default <tt>false</tt>
      *

http://git-wip-us.apache.org/repos/asf/camel/blob/e7eddb02/camel-core/src/main/java/org/apache/camel/processor/Throttler.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/processor/Throttler.java b/camel-core/src/main/java/org/apache/camel/processor/Throttler.java
index a48f6a5..f1dcfce 100644
--- a/camel-core/src/main/java/org/apache/camel/processor/Throttler.java
+++ b/camel-core/src/main/java/org/apache/camel/processor/Throttler.java
@@ -16,19 +16,13 @@
  */
 package org.apache.camel.processor;
 
-import java.util.concurrent.RejectedExecutionException;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.atomic.AtomicLong;
-
-import org.apache.camel.AsyncCallback;
-import org.apache.camel.CamelContext;
-import org.apache.camel.Exchange;
-import org.apache.camel.Expression;
-import org.apache.camel.Processor;
-import org.apache.camel.RuntimeExchangeException;
+import org.apache.camel.*;
 import org.apache.camel.Traceable;
 import org.apache.camel.util.ObjectHelper;
 
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.atomic.AtomicLong;
+
 /**
  * A <a href="http://camel.apache.org/throttler.html">Throttler</a>
  * will set a limit on the maximum number of message exchanges which can be sent
@@ -212,7 +206,7 @@ public class Throttler extends DelayProcessorSupport implements Traceable {
     @Override
     protected boolean processDelay(Exchange exchange, AsyncCallback callback, long delay) {
         if (isRejectExecution() && delay > 0) {
-            exchange.setException(new RejectedExecutionException("Exceed the max request limit!"));
+            exchange.setException(new ThrottlerRejectedExecutionException("Exceed the max request limit!"));
             callback.done(true);
             return true;
         } else {

http://git-wip-us.apache.org/repos/asf/camel/blob/e7eddb02/camel-core/src/main/java/org/apache/camel/processor/ThrottlerRejectedExecutionException.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/processor/ThrottlerRejectedExecutionException.java b/camel-core/src/main/java/org/apache/camel/processor/ThrottlerRejectedExecutionException.java
new file mode 100644
index 0000000..6790760
--- /dev/null
+++ b/camel-core/src/main/java/org/apache/camel/processor/ThrottlerRejectedExecutionException.java
@@ -0,0 +1,15 @@
+package org.apache.camel.processor;
+
+import java.util.concurrent.RejectedExecutionException;
+
+/**
+ * Created by david on 02/07/14.
+ */
+public class ThrottlerRejectedExecutionException
+    extends RejectedExecutionException
+{
+    public ThrottlerRejectedExecutionException(String message) {
+        super(message);
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/camel/blob/e7eddb02/camel-core/src/test/java/org/apache/camel/processor/ThrottlerTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/processor/ThrottlerTest.java b/camel-core/src/test/java/org/apache/camel/processor/ThrottlerTest.java
index c1ffbc1..f18631a 100644
--- a/camel-core/src/test/java/org/apache/camel/processor/ThrottlerTest.java
+++ b/camel-core/src/test/java/org/apache/camel/processor/ThrottlerTest.java
@@ -16,15 +16,15 @@
  */
 package org.apache.camel.processor;
 
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.RejectedExecutionException;
-
 import org.apache.camel.ContextTestSupport;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.impl.DefaultExchange;
 import org.apache.camel.processor.Throttler.TimeSlot;
+
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
 import static org.apache.camel.builder.Builder.constant;
 
 /**
@@ -222,7 +222,7 @@ public class ThrottlerTest extends ContextTestSupport {
         return new RouteBuilder() {
             public void configure() {
                 
-                onException(RejectedExecutionException.class)
+                onException(ThrottlerRejectedExecutionException.class)
                     .handled(true)
                     .to("mock:error");
                 

http://git-wip-us.apache.org/repos/asf/camel/blob/e7eddb02/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/throttler.xml
----------------------------------------------------------------------
diff --git a/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/throttler.xml b/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/throttler.xml
index 157db1a..11f8791 100644
--- a/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/throttler.xml
+++ b/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/throttler.xml
@@ -24,7 +24,7 @@
 
     <camelContext xmlns="http://camel.apache.org/schema/spring">
         <onException>
-            <exception>java.util.concurrent.RejectedExecutionException</exception>
+            <exception>org.apache.camel.processor.ThrottlerRejectedExecutionException</exception>
             <handled><constant>true</constant></handled>
             <to uri="mock:error"/>
         </onException>


[3/3] git commit: CAMEL-7504: Fixed CS

Posted by da...@apache.org.
CAMEL-7504: Fixed CS


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

Branch: refs/heads/master
Commit: 76ddb85f5de3f192e87e89574252445cff4209a8
Parents: 0cb6e84
Author: Claus Ibsen <da...@apache.org>
Authored: Wed Jul 2 21:01:19 2014 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Wed Jul 2 21:01:19 2014 +0200

----------------------------------------------------------------------
 .../src/main/java/org/apache/camel/processor/Throttler.java   | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/76ddb85f/camel-core/src/main/java/org/apache/camel/processor/Throttler.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/processor/Throttler.java b/camel-core/src/main/java/org/apache/camel/processor/Throttler.java
index f1dcfce..2ec37e4 100644
--- a/camel-core/src/main/java/org/apache/camel/processor/Throttler.java
+++ b/camel-core/src/main/java/org/apache/camel/processor/Throttler.java
@@ -16,7 +16,12 @@
  */
 package org.apache.camel.processor;
 
-import org.apache.camel.*;
+import org.apache.camel.AsyncCallback;
+import org.apache.camel.CamelContext;
+import org.apache.camel.Exchange;
+import org.apache.camel.Expression;
+import org.apache.camel.Processor;
+import org.apache.camel.RuntimeExchangeException;
 import org.apache.camel.Traceable;
 import org.apache.camel.util.ObjectHelper;
 


[2/3] git commit: Merge branch 'CAMEL-7504' of https://github.com/davidkarlsen/camel

Posted by da...@apache.org.
Merge branch 'CAMEL-7504' of https://github.com/davidkarlsen/camel


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

Branch: refs/heads/master
Commit: 0cb6e8426d9346a5fb1da4ff9ec5ac023b9b5190
Parents: 61839f2 e7eddb0
Author: Claus Ibsen <da...@apache.org>
Authored: Wed Jul 2 21:00:06 2014 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Wed Jul 2 21:00:06 2014 +0200

----------------------------------------------------------------------
 .../org/apache/camel/model/ThrottleDefinition.java  |  2 +-
 .../java/org/apache/camel/processor/Throttler.java  | 16 +++++-----------
 .../ThrottlerRejectedExecutionException.java        | 15 +++++++++++++++
 .../org/apache/camel/processor/ThrottlerTest.java   | 10 +++++-----
 .../org/apache/camel/spring/processor/throttler.xml |  2 +-
 5 files changed, 27 insertions(+), 18 deletions(-)
----------------------------------------------------------------------