camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1425296 - in /camel/branches/camel-2.10.x: ./ camel-core/src/main/java/org/apache/camel/model/ camel-core/src/test/java/org/apache/camel/issues/ components/camel-test-spring/src/test/java/org/apache/camel/test/issues/ components/camel-test...
Date Sat, 22 Dec 2012 15:34:42 GMT
Author: davsclaus
Date: Sat Dec 22 15:34:41 2012
New Revision: 1425296

URL: http://svn.apache.org/viewvc?rev=1425296&view=rev
Log:
CAMEL-5887: Fixed issue with context scoped onException and using advice with when advicing
multiple routes.

Added:
    camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/issues/AdviceWithOnExceptionMultipleIssueTest.java
      - copied unchanged from r1425295, camel/trunk/camel-core/src/test/java/org/apache/camel/issues/AdviceWithOnExceptionMultipleIssueTest.java
    camel/branches/camel-2.10.x/components/camel-test-spring/src/test/java/org/apache/camel/test/issues/
      - copied from r1425295, camel/trunk/components/camel-test-spring/src/test/java/org/apache/camel/test/issues/
    camel/branches/camel-2.10.x/components/camel-test-spring/src/test/resources/org/apache/camel/test/issues/
      - copied from r1425295, camel/trunk/components/camel-test-spring/src/test/resources/org/apache/camel/test/issues/
Modified:
    camel/branches/camel-2.10.x/   (props changed)
    camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/model/OnExceptionDefinition.java
    camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java
    camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/model/RouteDefinitionHelper.java
    camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/model/RoutesDefinition.java

Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
  Merged /camel/trunk:r1425295

Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/model/OnExceptionDefinition.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/model/OnExceptionDefinition.java?rev=1425296&r1=1425295&r2=1425296&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/model/OnExceptionDefinition.java
(original)
+++ camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/model/OnExceptionDefinition.java
Sat Dec 22 15:34:41 2012
@@ -102,6 +102,10 @@ public class OnExceptionDefinition exten
         exceptionClasses.add(exceptionType);
     }
 
+    public void setRouteScoped(boolean routeScoped) {
+        this.routeScoped = routeScoped;
+    }
+
     public boolean isRouteScoped() {
         // is context scoped by default
         return routeScoped != null ? routeScoped : false;

Modified: camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java?rev=1425296&r1=1425295&r2=1425296&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java
(original)
+++ camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java
Sat Dec 22 15:34:41 2012
@@ -2305,6 +2305,7 @@ public abstract class ProcessorDefinitio
      */
     public OnExceptionDefinition onException(Class<? extends Throwable> exceptionType)
{
         OnExceptionDefinition answer = new OnExceptionDefinition(exceptionType);
+        answer.setRouteScoped(true);
         addOutput(answer);
         return answer;
     }
@@ -2318,6 +2319,7 @@ public abstract class ProcessorDefinitio
      */
     public OnExceptionDefinition onException(Class<? extends Throwable>... exceptions)
{
         OnExceptionDefinition answer = new OnExceptionDefinition(Arrays.asList(exceptions));
+        answer.setRouteScoped(true);
         addOutput(answer);
         return answer;
     }

Modified: camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/model/RouteDefinitionHelper.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/model/RouteDefinitionHelper.java?rev=1425296&r1=1425295&r2=1425296&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/model/RouteDefinitionHelper.java
(original)
+++ camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/model/RouteDefinitionHelper.java
Sat Dec 22 15:34:41 2012
@@ -187,7 +187,11 @@ public final class RouteDefinitionHelper
                                          List<OnExceptionDefinition> onExceptions)
{
         // add global on exceptions if any
         if (onExceptions != null && !onExceptions.isEmpty()) {
-            abstracts.addAll(onExceptions);
+            for (OnExceptionDefinition output : onExceptions) {
+                // these are context scoped on exceptions so set this flag
+                output.setRouteScoped(false);
+                abstracts.add(output);
+            }
         }
 
         // now add onExceptions to the route

Modified: camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/model/RoutesDefinition.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/model/RoutesDefinition.java?rev=1425296&r1=1425295&r2=1425296&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/model/RoutesDefinition.java
(original)
+++ camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/model/RoutesDefinition.java
Sat Dec 22 15:34:41 2012
@@ -266,6 +266,7 @@ public class RoutesDefinition extends Op
      */
     public OnExceptionDefinition onException(Class<? extends Throwable> exception)
{
         OnExceptionDefinition answer = new OnExceptionDefinition(exception);
+        answer.setRouteScoped(false);
         getOnExceptions().add(answer);
         return answer;
     }



Mime
View raw message