camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject camel git commit: CAMEL-8317: XML DSL - Allow to use bean property style to configure endpoint options
Date Wed, 18 Mar 2015 19:53:20 GMT
Repository: camel
Updated Branches:
  refs/heads/camel-2.15.x 16cd310cf -> 4ed3dc4c9


CAMEL-8317: XML DSL - Allow to use bean property style to configure endpoint options


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

Branch: refs/heads/camel-2.15.x
Commit: 4ed3dc4c97b76b29b12fc7959e3b9ab4deada995
Parents: 16cd310
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Wed Mar 18 20:34:05 2015 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Wed Mar 18 20:55:02 2015 +0100

----------------------------------------------------------------------
 .../camel/core/xml/AbstractCamelEndpointFactoryBean.java  | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/4ed3dc4c/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelEndpointFactoryBean.java
----------------------------------------------------------------------
diff --git a/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelEndpointFactoryBean.java
b/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelEndpointFactoryBean.java
index 10f2d9c..7e9fd68 100644
--- a/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelEndpointFactoryBean.java
+++ b/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelEndpointFactoryBean.java
@@ -16,8 +16,6 @@
  */
 package org.apache.camel.core.xml;
 
-import java.io.UnsupportedEncodingException;
-import java.net.URISyntaxException;
 import java.util.ArrayList;
 import java.util.LinkedHashMap;
 import java.util.List;
@@ -51,6 +49,8 @@ public abstract class AbstractCamelEndpointFactoryBean extends AbstractCamelFact
 
     public Endpoint getObject() throws Exception {
         if (endpoint == null || !endpoint.isSingleton()) {
+            // resolve placeholders
+            this.uri = getCamelContext().resolvePropertyPlaceholders(uri);
             String target = createUri();
             endpoint = getCamelContext().getEndpoint(target);
             if (endpoint == null) {
@@ -112,13 +112,15 @@ public abstract class AbstractCamelEndpointFactoryBean extends AbstractCamelFact
         this.properties = properties;
     }
 
-    private String createUri() throws UnsupportedEncodingException, URISyntaxException {
+    private String createUri() throws Exception {
         if (properties == null || properties.isEmpty()) {
             return uri;
         } else {
             Map<String, Object> map = new LinkedHashMap<String, Object>();
             for (PropertyDefinition property : properties) {
-                map.put(property.getKey(), property.getValue());
+                // resolve placeholders for each value
+                String value = getCamelContext().resolvePropertyPlaceholders(property.getValue());
+                map.put(property.getKey(), value);
             }
             return URISupport.appendParametersToURI(uri, map);
         }


Mime
View raw message