Rename {Default=>Standard}Environment

Issue: SPR-8348
This commit is contained in:
Chris Beams
2011-05-20 03:53:37 +00:00
parent 615fcff7ae
commit c06752ef72
26 changed files with 114 additions and 113 deletions

View File

@@ -22,7 +22,7 @@ import java.util.Set;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.BeanDefinitionStoreException;
import org.springframework.core.env.DefaultEnvironment;
import org.springframework.core.env.StandardEnvironment;
import org.springframework.core.env.Environment;
import org.springframework.core.env.EnvironmentCapable;
import org.springframework.core.io.Resource;
@@ -54,7 +54,7 @@ public abstract class AbstractBeanDefinitionReader implements EnvironmentCapable
private ClassLoader beanClassLoader;
private Environment environment = new DefaultEnvironment();
private Environment environment = new StandardEnvironment();
private BeanNameGenerator beanNameGenerator = new DefaultBeanNameGenerator();
@@ -69,7 +69,7 @@ public abstract class AbstractBeanDefinitionReader implements EnvironmentCapable
* {@link org.springframework.core.io.support.PathMatchingResourcePatternResolver}.
* <p>If the the passed-in bean factory also implements {@link EnvironmentCapable} its
* environment will be used by this reader. Otherwise, the reader will initialize and
* use a {@link DefaultEnvironment}. All ApplicationContext implementations are
* use a {@link StandardEnvironment}. All ApplicationContext implementations are
* EnvironmentCapable, while normal BeanFactory implementations are not.
* @param registry the BeanFactory to load bean definitions into,
* in the form of a BeanDefinitionRegistry
@@ -93,7 +93,7 @@ public abstract class AbstractBeanDefinitionReader implements EnvironmentCapable
this.environment = ((EnvironmentCapable)this.registry).getEnvironment();
}
else {
this.environment = new DefaultEnvironment();
this.environment = new StandardEnvironment();
}
}

View File

@@ -69,7 +69,7 @@ import org.springframework.core.DecoratingClassLoader;
import org.springframework.core.NamedThreadLocal;
import org.springframework.core.convert.ConversionService;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.core.env.DefaultEnvironment;
import org.springframework.core.env.StandardEnvironment;
import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;
import org.springframework.util.ObjectUtils;

View File

@@ -59,7 +59,7 @@ import org.springframework.beans.factory.support.ManagedProperties;
import org.springframework.beans.factory.support.ManagedSet;
import org.springframework.beans.factory.support.MethodOverrides;
import org.springframework.beans.factory.support.ReplaceOverride;
import org.springframework.core.env.DefaultEnvironment;
import org.springframework.core.env.StandardEnvironment;
import org.springframework.core.env.Environment;
import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;
@@ -272,13 +272,13 @@ public class BeanDefinitionParserDelegate {
/**
* Create a new BeanDefinitionParserDelegate associated with the
* supplied {@link XmlReaderContext} and a new {@link DefaultEnvironment}.
* supplied {@link XmlReaderContext} and a new {@link StandardEnvironment}.
* @deprecated since Spring 3.1 in favor of
* {@link #BeanDefinitionParserDelegate(XmlReaderContext, Environment)}
*/
@Deprecated
public BeanDefinitionParserDelegate(XmlReaderContext readerContext) {
this(readerContext, new DefaultEnvironment());
this(readerContext, new StandardEnvironment());
}
/**

View File

@@ -34,7 +34,7 @@ import org.springframework.beans.propertyeditors.InputSourceEditor;
import org.springframework.beans.propertyeditors.InputStreamEditor;
import org.springframework.beans.propertyeditors.URIEditor;
import org.springframework.beans.propertyeditors.URLEditor;
import org.springframework.core.env.DefaultEnvironment;
import org.springframework.core.env.StandardEnvironment;
import org.springframework.core.env.Environment;
import org.springframework.core.env.PropertyResolver;
import org.springframework.core.io.Resource;
@@ -64,7 +64,7 @@ public class ResourceEditorRegistrar implements PropertyEditorRegistrar {
/**
* Create a new ResourceEditorRegistrar for the given {@link ResourceLoader}
* using a {@link DefaultEnvironment}.
* using a {@link StandardEnvironment}.
* @param resourceLoader the ResourceLoader (or ResourcePatternResolver)
* to create editors for (usually an ApplicationContext)
* @see org.springframework.core.io.support.ResourcePatternResolver
@@ -74,7 +74,7 @@ public class ResourceEditorRegistrar implements PropertyEditorRegistrar {
*/
@Deprecated
public ResourceEditorRegistrar(ResourceLoader resourceLoader) {
this(resourceLoader, new DefaultEnvironment());
this(resourceLoader, new StandardEnvironment());
}
/**

View File

@@ -6,7 +6,7 @@ import static org.junit.Assert.assertThat;
import org.junit.Test;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.core.env.DefaultEnvironment;
import org.springframework.core.env.StandardEnvironment;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
@@ -30,7 +30,7 @@ public class NestedBeansElementTests {
@Test
public void getBean_withActiveProfile() {
ConfigurableEnvironment env = new DefaultEnvironment();
ConfigurableEnvironment env = new StandardEnvironment();
env.setActiveProfiles("dev");
DefaultListableBeanFactory bf = new DefaultListableBeanFactory();

View File

@@ -26,7 +26,7 @@ import org.junit.internal.matchers.TypeSafeMatcher;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.core.env.DefaultEnvironment;
import org.springframework.core.env.StandardEnvironment;
import org.springframework.core.io.ClassPathResource;
/**
@@ -99,7 +99,7 @@ public class ProfileXmlBeanDefinitionTests {
{
DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory();
XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(beanFactory);
ConfigurableEnvironment env = new DefaultEnvironment();
ConfigurableEnvironment env = new StandardEnvironment();
env.setDefaultProfiles("custom-default");
reader.setEnvironment(env);
reader.loadBeanDefinitions(new ClassPathResource(DEFAULT_ELIGIBLE_XML, getClass()));
@@ -109,7 +109,7 @@ public class ProfileXmlBeanDefinitionTests {
{
DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory();
XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(beanFactory);
ConfigurableEnvironment env = new DefaultEnvironment();
ConfigurableEnvironment env = new StandardEnvironment();
env.setDefaultProfiles("custom-default");
reader.setEnvironment(env);
reader.loadBeanDefinitions(new ClassPathResource(CUSTOM_DEFAULT_ELIGIBLE_XML, getClass()));
@@ -126,7 +126,7 @@ public class ProfileXmlBeanDefinitionTests {
{
DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory();
XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(beanFactory);
ConfigurableEnvironment env = new DefaultEnvironment();
ConfigurableEnvironment env = new StandardEnvironment();
env.setActiveProfiles(DEV_ACTIVE);
env.setDefaultProfiles("default");
reader.setEnvironment(env);
@@ -136,7 +136,7 @@ public class ProfileXmlBeanDefinitionTests {
{
DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory();
XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(beanFactory);
ConfigurableEnvironment env = new DefaultEnvironment();
ConfigurableEnvironment env = new StandardEnvironment();
// env.setActiveProfiles(DEV_ACTIVE);
env.setDefaultProfiles("default");
reader.setEnvironment(env);
@@ -146,7 +146,7 @@ public class ProfileXmlBeanDefinitionTests {
{
DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory();
XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(beanFactory);
ConfigurableEnvironment env = new DefaultEnvironment();
ConfigurableEnvironment env = new StandardEnvironment();
// env.setActiveProfiles(DEV_ACTIVE);
//env.setDefaultProfiles("default");
reader.setEnvironment(env);
@@ -159,7 +159,7 @@ public class ProfileXmlBeanDefinitionTests {
private BeanDefinitionRegistry beanFactoryFor(String xmlName, String... activeProfiles) {
DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory();
XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(beanFactory);
DefaultEnvironment env = new DefaultEnvironment();
StandardEnvironment env = new StandardEnvironment();
env.setActiveProfiles(activeProfiles);
reader.setEnvironment(env);
reader.loadBeanDefinitions(new ClassPathResource(xmlName, getClass()));