Browse Source

PropertyPlaceholderConfigurer is compatible with Spring 2.5 extensions such as GigaSpaces again (SPR-6514)

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@2609 50f2f4bb-b051-0410-bef5-90022cba6387
pull/1/head
Juergen Hoeller 16 years ago
parent
commit
0dae3cf6ea
  1. 4
      org.springframework.beans/src/main/java/org/springframework/beans/factory/access/SingletonBeanFactoryLocator.java
  2. 22
      org.springframework.beans/src/main/java/org/springframework/beans/factory/config/PropertyPlaceholderConfigurer.java

4
org.springframework.beans/src/main/java/org/springframework/beans/factory/access/SingletonBeanFactoryLocator.java

@ -387,12 +387,12 @@ public class SingletonBeanFactoryLocator implements BeanFactoryLocator { @@ -387,12 +387,12 @@ public class SingletonBeanFactoryLocator implements BeanFactoryLocator {
this.bfgInstancesByKey.remove(this.resourceLocation);
this.bfgInstancesByObj.remove(groupContext);
throw new BootstrapException("Unable to initialize group definition. " +
"Group resource name [" + this.resourceLocation + "], factory key [" + factoryKey + "]", ex);
"Group resource name [" + this.resourceLocation + "], factory key [" + factoryKey + "]", ex);
}
}
try {
BeanFactory beanFactory = null;
BeanFactory beanFactory;
if (factoryKey != null) {
beanFactory = bfg.definition.getBean(factoryKey, BeanFactory.class);
}

22
org.springframework.beans/src/main/java/org/springframework/beans/factory/config/PropertyPlaceholderConfigurer.java

@ -17,6 +17,7 @@ @@ -17,6 +17,7 @@
package org.springframework.beans.factory.config;
import java.util.Properties;
import java.util.Set;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanDefinitionStoreException;
@ -352,12 +353,25 @@ public class PropertyPlaceholderConfigurer extends PropertyResourceConfigurer @@ -352,12 +353,25 @@ public class PropertyPlaceholderConfigurer extends PropertyResourceConfigurer
}
}
/**
* BeanDefinitionVisitor that resolves placeholders in String values,
* delegating to the <code>parseStringValue</code> method of the
* containing class.
* Parse the given String value for placeholder resolution.
* @param strVal the String value to parse
* @param props the Properties to resolve placeholders against
* @param visitedPlaceholders the placeholders that have already been visited
* during the current resolution attempt (ignored in this version of the code)
* @deprecated as of Spring 3.0, in favor of using {@link #resolvePlaceholder}
* with {@link org.springframework.util.PropertyPlaceholderHelper}.
* Only retained for compatibility with Spring 2.5 extensions.
*/
@Deprecated
protected String parseStringValue(String strVal, Properties props, Set visitedPlaceholders) {
PropertyPlaceholderHelper helper = new PropertyPlaceholderHelper(
placeholderPrefix, placeholderSuffix, valueSeparator, ignoreUnresolvablePlaceholders);
PlaceholderResolver resolver = new PropertyPlaceholderConfigurerResolver(props);
return helper.replacePlaceholders(strVal, resolver);
}
private class PlaceholderResolvingStringValueResolver implements StringValueResolver {
private final PropertyPlaceholderHelper helper;

Loading…
Cancel
Save