Rename {Default=>Standard}Environment
Issue: SPR-8348
This commit is contained in:
@@ -24,7 +24,7 @@ import org.springframework.beans.factory.support.AutowireCandidateQualifier;
|
||||
import org.springframework.beans.factory.support.BeanDefinitionReaderUtils;
|
||||
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
|
||||
import org.springframework.beans.factory.support.BeanNameGenerator;
|
||||
import org.springframework.core.env.DefaultEnvironment;
|
||||
import org.springframework.core.env.StandardEnvironment;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.core.type.AnnotationMetadata;
|
||||
|
||||
@@ -42,7 +42,7 @@ public class AnnotatedBeanDefinitionReader {
|
||||
|
||||
private final BeanDefinitionRegistry registry;
|
||||
|
||||
private Environment environment = new DefaultEnvironment();
|
||||
private Environment environment = new StandardEnvironment();
|
||||
|
||||
private BeanNameGenerator beanNameGenerator = new AnnotationBeanNameGenerator();
|
||||
|
||||
@@ -70,7 +70,7 @@ public class AnnotatedBeanDefinitionReader {
|
||||
/**
|
||||
* Set the Environment to use when evaluating whether
|
||||
* {@link Profile @Profile}-annotated component classes should be registered.
|
||||
* <p>The default is a {@link DefaultEnvironment}.
|
||||
* <p>The default is a {@link StandardEnvironment}.
|
||||
* @see #registerBean(Class, String, Class...)
|
||||
*/
|
||||
public void setEnvironment(Environment environment) {
|
||||
|
||||
@@ -91,8 +91,9 @@ public class ClassPathBeanDefinitionScanner extends ClassPathScanningCandidateCo
|
||||
* {@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
|
||||
* EnvironmentCapable, while normal BeanFactory implementations are not.
|
||||
* use a {@link org.springframework.core.env.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
|
||||
* @param useDefaultFilters whether to include the default filters for the
|
||||
|
||||
@@ -29,7 +29,7 @@ import org.springframework.beans.factory.BeanDefinitionStoreException;
|
||||
import org.springframework.beans.factory.annotation.AnnotatedBeanDefinition;
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.context.ResourceLoaderAware;
|
||||
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;
|
||||
@@ -73,7 +73,7 @@ public class ClassPathScanningCandidateComponentProvider implements EnvironmentC
|
||||
|
||||
protected final Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
private Environment environment = new DefaultEnvironment();
|
||||
private Environment environment = new StandardEnvironment();
|
||||
|
||||
private ResourcePatternResolver resourcePatternResolver = new PathMatchingResourcePatternResolver();
|
||||
|
||||
@@ -117,7 +117,7 @@ public class ClassPathScanningCandidateComponentProvider implements EnvironmentC
|
||||
/**
|
||||
* Set the Environment to use when resolving placeholders and evaluating
|
||||
* {@link Profile @Profile}-annotated component classes.
|
||||
* <p>The default is a {@link DefaultEnvironment}
|
||||
* <p>The default is a {@link StandardEnvironment}
|
||||
* @param environment the Environment to use
|
||||
*/
|
||||
public void setEnvironment(Environment environment) {
|
||||
|
||||
@@ -73,7 +73,7 @@ import org.springframework.core.Ordered;
|
||||
import org.springframework.core.PriorityOrdered;
|
||||
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.core.io.DefaultResourceLoader;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.core.io.ResourceLoader;
|
||||
@@ -410,12 +410,12 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader
|
||||
}
|
||||
|
||||
/**
|
||||
* Create and return a new {@link DefaultEnvironment}.
|
||||
* Create and return a new {@link StandardEnvironment}.
|
||||
* <p>Subclasses may override this method in order to supply
|
||||
* a custom {@link ConfigurableEnvironment} implementation.
|
||||
*/
|
||||
protected ConfigurableEnvironment createEnvironment() {
|
||||
return new DefaultEnvironment();
|
||||
return new StandardEnvironment();
|
||||
}
|
||||
|
||||
public void refresh() throws BeansException, IllegalStateException {
|
||||
|
||||
Reference in New Issue
Block a user