camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject camel git commit: Use "" for the default name for the rest route to make sure it doesn't try to lookup a component named "default". Someday there might actually be a component named that. :)
Date Fri, 24 Jul 2015 14:05:48 GMT
Repository: camel
Updated Branches:
  refs/heads/master 0b22a495c -> d62cbe8ec


Use "" for the default name for the rest route to make sure it doesn't try to lookup a component
named "default".  Someday there might actually be a component named that.  :)


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

Branch: refs/heads/master
Commit: d62cbe8ec7c1f3dcb418215dc4d80b534e77f4be
Parents: 0b22a49
Author: Daniel Kulp <dkulp@apache.org>
Authored: Fri Jul 24 10:04:59 2015 -0400
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Fri Jul 24 10:04:59 2015 -0400

----------------------------------------------------------------------
 .../src/main/java/org/apache/camel/builder/RouteBuilder.java | 8 +++++---
 .../main/java/org/apache/camel/impl/DefaultCamelContext.java | 6 +++---
 .../java/org/apache/camel/model/rest/RestDefinition.java     | 2 +-
 3 files changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/d62cbe8e/camel-core/src/main/java/org/apache/camel/builder/RouteBuilder.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/builder/RouteBuilder.java b/camel-core/src/main/java/org/apache/camel/builder/RouteBuilder.java
index d12298a..c0ea23f 100644
--- a/camel-core/src/main/java/org/apache/camel/builder/RouteBuilder.java
+++ b/camel-core/src/main/java/org/apache/camel/builder/RouteBuilder.java
@@ -82,7 +82,7 @@ public abstract class RouteBuilder extends BuilderSupport implements RoutesBuild
      * @return the builder
      */
     public RestConfigurationDefinition restConfiguration() {
-        return restConfiguration("default");
+        return restConfiguration("");
     }
 
     /**
@@ -97,7 +97,9 @@ public abstract class RouteBuilder extends BuilderSupport implements RoutesBuild
         RestConfigurationDefinition restConfiguration = restConfigurations.get(component);
         if (restConfiguration == null) {
             restConfiguration = new RestConfigurationDefinition();
-            restConfiguration.component(component);
+            if (!component.isEmpty()) {
+                restConfiguration.component(component);
+            }
             restConfigurations.put(component, restConfiguration);
         }
         return restConfiguration;
@@ -425,7 +427,7 @@ public abstract class RouteBuilder extends BuilderSupport implements RoutesBuild
         if (getRestConfiguration() != null) {
             for (Map.Entry<String, RestConfigurationDefinition> entry : getRestConfiguration().entrySet())
{
                 RestConfiguration config = entry.getValue().asRestConfiguration(getContext());
-                if ("default".equals(entry.getKey())) {
+                if ("".equals(entry.getKey())) {
                     camelContext.setRestConfiguration(config);
                 } else {
                     camelContext.addRestConfiguration(config);

http://git-wip-us.apache.org/repos/asf/camel/blob/d62cbe8e/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java b/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
index 5fefcfa..10fbff9 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
@@ -2298,7 +2298,7 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon
     }
 
     public RestConfiguration getRestConfiguration() {
-        RestConfiguration config = restConfigurations.get("default");
+        RestConfiguration config = restConfigurations.get("");
         if (config == null) {
             config = new RestConfiguration();
             setRestConfiguration(config);
@@ -2307,7 +2307,7 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon
     }
 
     public void setRestConfiguration(RestConfiguration restConfiguration) {
-        restConfigurations.put("default", restConfiguration);
+        restConfigurations.put("", restConfiguration);
     }
     public Collection<RestConfiguration> getRestConfigurations() {
         return restConfigurations.values();
@@ -2319,7 +2319,7 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon
     }
     public RestConfiguration getRestConfiguration(String component, boolean defaultIfNotExist)
{
         if (component == null) {
-            component = "default";
+            component = "";
         }
         RestConfiguration config = restConfigurations.get(component);
         if (config == null && defaultIfNotExist) {

http://git-wip-us.apache.org/repos/asf/camel/blob/d62cbe8e/camel-core/src/main/java/org/apache/camel/model/rest/RestDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/rest/RestDefinition.java b/camel-core/src/main/java/org/apache/camel/model/rest/RestDefinition.java
index 5f01e80..f1b9d26 100644
--- a/camel-core/src/main/java/org/apache/camel/model/rest/RestDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/rest/RestDefinition.java
@@ -566,7 +566,7 @@ public class RestDefinition extends OptionalIdentifiedDefinition<RestDefinition>
             }
             String routeId = route.idOrCreate(camelContext.getNodeIdFactory());
             options.put("routeId", routeId);
-            if (component != null) {
+            if (component != null && !component.isEmpty()) {
                 options.put("componentName", component);
             }
 


Mime
View raw message