PropertyPlaceholderConfigurer is compatible with Spring 2.5 extensions such as GigaSpaces again (SPR-6514)
This commit is contained in:
parent
3ffc2ba48d
commit
ad29a2376d
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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…
Reference in New Issue