Author: davsclaus
Date: Wed Apr  3 13:27:18 2013
New Revision: 1463999

URL: http://svn.apache.org/r1463999
Log:
CAMEL-6233: BridgePropertyPlaceholderConfigurer does not support nested Spring 
properties

Modified:
    camel/branches/camel-2.10.x/   (props changed)
    
camel/branches/camel-2.10.x/components/camel-spring/src/main/java/org/apache/camel/spring/spi/BridgePropertyPlaceholderConfigurer.java

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

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

Modified: 
camel/branches/camel-2.10.x/components/camel-spring/src/main/java/org/apache/camel/spring/spi/BridgePropertyPlaceholderConfigurer.java
URL: 
http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-spring/src/main/java/org/apache/camel/spring/spi/BridgePropertyPlaceholderConfigurer.java?rev=1463999&r1=1463998&r2=1463999&view=diff
==============================================================================
--- 
camel/branches/camel-2.10.x/components/camel-spring/src/main/java/org/apache/camel/spring/spi/BridgePropertyPlaceholderConfigurer.java
 (original)
+++ 
camel/branches/camel-2.10.x/components/camel-spring/src/main/java/org/apache/camel/spring/spi/BridgePropertyPlaceholderConfigurer.java
 Wed Apr  3 13:27:18 2013
@@ -42,13 +42,23 @@ public class BridgePropertyPlaceholderCo
     private String id;
     private PropertyPlaceholderHelper helper;
 
+    // to support both Spring 3.0 / 3.1+ we need to keep track of these as 
they have private modified in Spring 3.0
+    private String configuredPlaceholderPrefix;
+    private String configuredPlaceholderSuffix;
+    private String configuredValueSeparator;
+    private Boolean configuredIgnoreUnresolvablePlaceholders;
+
     @Override
     protected void processProperties(ConfigurableListableBeanFactory 
beanFactoryToProcess, Properties props) throws BeansException {
         super.processProperties(beanFactoryToProcess, props);
         // store all the spring properties so we can refer to them later
         properties.putAll(props);
         // create helper
-        helper = new PropertyPlaceholderHelper(placeholderPrefix, 
placeholderSuffix, valueSeparator, ignoreUnresolvablePlaceholders);
+        helper = new PropertyPlaceholderHelper(
+                configuredPlaceholderPrefix != null ? 
configuredPlaceholderPrefix : DEFAULT_PLACEHOLDER_PREFIX,
+                configuredPlaceholderSuffix != null ? 
configuredPlaceholderSuffix : DEFAULT_PLACEHOLDER_SUFFIX,
+                configuredValueSeparator != null ? configuredValueSeparator : 
DEFAULT_VALUE_SEPARATOR,
+                configuredIgnoreUnresolvablePlaceholders != null ? 
configuredIgnoreUnresolvablePlaceholders : false);
     }
 
     @Override
@@ -58,6 +68,30 @@ public class BridgePropertyPlaceholderCo
     }
 
     @Override
+    public void setPlaceholderPrefix(String placeholderPrefix) {
+        super.setPlaceholderPrefix(placeholderPrefix);
+        this.configuredPlaceholderPrefix = placeholderPrefix;
+    }
+
+    @Override
+    public void setPlaceholderSuffix(String placeholderSuffix) {
+        super.setPlaceholderSuffix(placeholderSuffix);
+        this.configuredPlaceholderSuffix = placeholderSuffix;
+    }
+
+    @Override
+    public void setValueSeparator(String valueSeparator) {
+        super.setValueSeparator(valueSeparator);
+        this.configuredValueSeparator = valueSeparator;
+    }
+
+    @Override
+    public void setIgnoreUnresolvablePlaceholders(boolean 
ignoreUnresolvablePlaceholders) {
+        
super.setIgnoreUnresolvablePlaceholders(ignoreUnresolvablePlaceholders);
+        this.configuredIgnoreUnresolvablePlaceholders = 
ignoreUnresolvablePlaceholders;
+    }
+
+    @Override
     public Properties resolveProperties(CamelContext context, boolean 
ignoreMissingLocation, String... uri) throws Exception {
         // return the spring properties, if it
         Properties answer = new Properties();


Reply via email to