camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hadr...@apache.org
Subject svn commit: r647864 - in /activemq/camel/trunk/camel-core/src: main/java/org/apache/camel/model/ProcessorType.java test/java/org/apache/camel/issues/InterceptorLogTest.java
Date Mon, 14 Apr 2008 15:52:45 GMT
Author: hadrian
Date: Mon Apr 14 08:52:42 2008
New Revision: 647864

URL: http://svn.apache.org/viewvc?rev=647864&view=rev
Log:
Minor fix in intercept handling.

Modified:
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorType.java
    activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/issues/InterceptorLogTest.java

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorType.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorType.java?rev=647864&r1=647863&r2=647864&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorType.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorType.java
Mon Apr 14 08:52:42 2008
@@ -868,11 +868,16 @@
 
     public Type proceed() {
         ProceedType proceed = null;
-        for (ProcessorType node = parent; node != null; node = node.getParent()) {
-            if (node instanceof InterceptType) {
-                InterceptType intercept = (InterceptType) node;
-                proceed = intercept.getProceed();
-                break;
+        if (this instanceof InterceptType) {
+            proceed = ((InterceptType) this).getProceed();
+        }
+        if (proceed == null) {
+        	for (ProcessorType node = parent; node != null; node = node.getParent()) {
+                if (node instanceof InterceptType) {
+                    InterceptType intercept = (InterceptType) node;
+                    proceed = intercept.getProceed();
+                    break;
+                }
             }
         }
         
@@ -884,8 +889,6 @@
             throw new IllegalArgumentException("Cannot use proceed() without being within
an intercept() block");
         }
 
-        // TODO we should be looking up the stack to find the last InterceptType
-        // and returning its ProceedType!
         addOutput(proceed);
         return (Type) this;
     }

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/issues/InterceptorLogTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/issues/InterceptorLogTest.java?rev=647864&r1=647863&r2=647864&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/issues/InterceptorLogTest.java
(original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/issues/InterceptorLogTest.java
Mon Apr 14 08:52:42 2008
@@ -39,8 +39,8 @@
     protected RouteBuilder createRouteBuilder() throws Exception {
         return new RouteBuilder() {
             public void configure() throws Exception {
-                // lets log all steps in all routes (must use proceed to let the exchange
gots by its
-                // normal route path instead of swalling it here by our interception
+                // lets log all steps in all routes (must use proceed to let the exchange
continue its
+                // normal route path instead of swallowing it here by our intercepter.
                 intercept().to("log:foo").proceed();
 
                 from("seda:foo").to("seda:bar");



Mime
View raw message