camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r836212 - in /camel/trunk/components/camel-spring/src: main/java/org/apache/camel/spring/CamelContextFactoryBean.java test/resources/log4j.properties
Date Sat, 14 Nov 2009 16:49:54 GMT
Author: davsclaus
Date: Sat Nov 14 16:49:53 2009
New Revision: 836212

URL: http://svn.apache.org/viewvc?rev=836212&view=rev
Log:
CAMEL-2721: Routes created with Spring XML did not set parent on the definition model objects.

Modified:
    camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java
    camel/trunk/components/camel-spring/src/test/resources/log4j.properties

Modified: camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java?rev=836212&r1=836211&r2=836212&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java
(original)
+++ camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java
Sat Nov 14 16:49:53 2009
@@ -303,6 +303,8 @@
             initOnExceptions(route);
             // and then for toAsync
             initToAsync(route);
+            // configure parents
+            initParent(route);
         }
 
         if (dataFormats != null) {
@@ -319,6 +321,27 @@
         installRoutes();
     }
 
+    private void initParent(RouteDefinition route) {
+        for (ProcessorDefinition<?> output : route.getOutputs()) {
+            output.setParent(route);
+            if (output.getOutputs() != null) {
+                // recursive the outputs
+                initParent(output);
+            }
+        }
+    }
+
+    private void initParent(ProcessorDefinition<?> parent) {
+        List<ProcessorDefinition> children = parent.getOutputs();
+        for (ProcessorDefinition child : children) {
+            child.setParent(parent);
+            if (child.getOutputs() != null) {
+                // recursive the children
+                initParent(child);
+            }
+        }
+    }
+
     private void initToAsync(RouteDefinition route) {
         List<ProcessorDefinition<?>> outputs = new ArrayList<ProcessorDefinition<?>>();
         ToDefinition toAsync = null;

Modified: camel/trunk/components/camel-spring/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/log4j.properties?rev=836212&r1=836211&r2=836212&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/resources/log4j.properties (original)
+++ camel/trunk/components/camel-spring/src/test/resources/log4j.properties Sat Nov 14 16:49:53
2009
@@ -18,7 +18,7 @@
 #
 # The logging properties used for eclipse testing, We want to see debug output on the console.
 #
-log4j.rootLogger=WARN, out
+log4j.rootLogger=WARN, file
 
 log4j.logger.org.springframework=WARN
 log4j.logger.org.apache.camel.impl.converter=WARN



Mime
View raw message