camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r1402468 - in /camel/branches/camel-2.10.x: ./ components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/EndpointDefinitionParser.java
Date Fri, 26 Oct 2012 11:22:32 GMT
Author: ningjiang
Date: Fri Oct 26 11:22:32 2012
New Revision: 1402468

URL: http://svn.apache.org/viewvc?rev=1402468&view=rev
Log:
CAMEL-5744 applied patch with thanks to Aki

Modified:
    camel/branches/camel-2.10.x/   (props changed)
    camel/branches/camel-2.10.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/EndpointDefinitionParser.java

Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
  Merged /camel/trunk:r1402383

Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: camel/branches/camel-2.10.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/EndpointDefinitionParser.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/EndpointDefinitionParser.java?rev=1402468&r1=1402467&r2=1402468&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/EndpointDefinitionParser.java
(original)
+++ camel/branches/camel-2.10.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/EndpointDefinitionParser.java
Fri Oct 26 11:22:32 2012
@@ -27,7 +27,6 @@ import org.apache.aries.blueprint.Parser
 import org.apache.aries.blueprint.mutable.MutableBeanMetadata;
 import org.apache.camel.component.cxf.CxfBlueprintEndpoint;
 import org.apache.cxf.common.util.StringUtils;
-import org.apache.cxf.configuration.blueprint.AbstractBPBeanDefinitionParser;
 import org.apache.cxf.helpers.DOMUtils;
 import org.osgi.framework.BundleContext;
 import org.osgi.service.blueprint.reflect.Metadata;
@@ -54,12 +53,16 @@ public class EndpointDefinitionParser ex
                 address = val;
             } else if (isAttribute(pre, name)) {
                 if ("endpointName".equals(name) || "serviceName".equals(name)) {
-                    QName q = parseQName(element, val);
-                    endpointConfig.addProperty(name, createValue(context, q));
+                    if (isPlaceHolder(val)) {
+                        endpointConfig.addProperty(name + "String", createValue(context,
val));
+                    } else {
+                        QName q = parseQName(element, val);
+                        endpointConfig.addProperty(name, createValue(context, q));
+                    }
                 } else if ("depends-on".equals(name)) {
                     endpointConfig.addDependsOn(val);
                 } else if (!"name".equals(name)) {
-                    endpointConfig.addProperty(name, AbstractBPBeanDefinitionParser.createValue(context,
val));
+                    endpointConfig.addProperty(name, createValue(context, val));
                 }
             }
         }
@@ -89,11 +92,19 @@ public class EndpointDefinitionParser ex
 
         endpointConfig.addProperty("bus", getBusRef(context, bus));
         endpointConfig.setDestroyMethod("destroy");
-        endpointConfig.addArgument(AbstractBPBeanDefinitionParser.createValue(context, address),
String.class.getName(), 0);
+        endpointConfig.addArgument(createValue(context, address), String.class.getName(),
0);
         endpointConfig.addArgument(createRef(context, "blueprintBundleContext"),
                                    BundleContext.class.getName(), 1);
 
         return endpointConfig;
     }
+
+    private static boolean isPlaceHolder(String value) {
+        if (value != null && (value.startsWith("${") && value.endsWith("}")
+            || value.startsWith("{{") && value.endsWith("}}"))) {
+            return true;
+        }
+        return false;
+    }
     
 }



Mime
View raw message