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 2013/09/02 17:41:59 UTC

[3/5] git commit: CAMEL-6699: Fixed using in OSGi Blueprint.

CAMEL-6699: Fixed using <routeBuilder ref> in OSGi Blueprint.


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

Branch: refs/heads/camel-2.12.x
Commit: 72807c48679ec2819b8fcf46712c129c4c4b71cd
Parents: 20b60b7
Author: Claus Ibsen <da...@apache.org>
Authored: Mon Sep 2 17:40:31 2013 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Mon Sep 2 17:40:55 2013 +0200

----------------------------------------------------------------------
 .../core/xml/AbstractCamelContextFactoryBean.java  | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/72807c48/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java
----------------------------------------------------------------------
diff --git a/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java b/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java
index 8e0b498..621d645 100644
--- a/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java
+++ b/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java
@@ -721,21 +721,14 @@ public abstract class AbstractCamelContextFactoryBean<T extends ModelCamelContex
     protected void installRoutes() throws Exception {
         List<RouteBuilder> builders = new ArrayList<RouteBuilder>();
 
-        // lets add route builders added from references
+        // lets add RoutesBuilder's added from references
         if (getBuilderRefs() != null) {
             for (RouteBuilderDefinition builderRef : getBuilderRefs()) {
-                RouteBuilder builder = builderRef.createRouteBuilder(getContext());
-                if (builder != null) {
-                    builders.add(builder);
+                RoutesBuilder routes = builderRef.createRoutes(getContext());
+                if (routes != null) {
+                    this.builders.add(routes);
                 } else {
-                    // support to get the route here
-                    RoutesBuilder routes = builderRef.createRoutes(getContext());
-                    if (routes != null) {
-                        this.builders.add(routes);
-                    } else {
-                        // Throw the exception that we can't find any build here
-                        throw new CamelException("Cannot find any routes with this RouteBuilder reference: " + builderRef);
-                    }
+                    throw new CamelException("Cannot find any routes with this RouteBuilder reference: " + builderRef);
                 }
             }
         }