Skip to content

Commit 111fb71

Browse files
committed
Remove "Feature" support introduced in 3.1 M1
Feature-related support such as @feature, @FeatureConfiguration, and FeatureSpecification types will be replaced by framework-provided @configuration classes and convenience annotations such as @componentscan (already exists), @EnableAsync, @EnableScheduling, @EnableTransactionManagement and others. Issue: SPR-8012,SPR-8034,SPR-8039,SPR-8188,SPR-8206,SPR-8223, SPR-8225,SPR-8226,SPR-8227
1 parent 0a790c1 commit 111fb71

File tree

80 files changed

+858
-6738
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+858
-6738
lines changed

build-spring-framework/resources/changelog.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ Changes in version 3.1 M2 (2011-??-??)
77
--------------------------------------
88

99
* deprecated AbstractJUnit38SpringContextTests and AbstractTransactionalJUnit38SpringContextTests
10+
* eliminated @Feature support in favor of @Enable* and framework-provided @Configuration classes
11+
* introduced @EnableTransactionManagement, @EnableScheduling, and other @Enable* annotations
1012

1113

1214
Changes in version 3.1 M1 (2011-02-11)

org.springframework.aop/src/main/java/org/springframework/aop/config/AopNamespaceUtils.java

Lines changed: 7 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,12 @@
1616

1717
package org.springframework.aop.config;
1818

19+
import org.w3c.dom.Element;
20+
1921
import org.springframework.beans.factory.config.BeanDefinition;
2022
import org.springframework.beans.factory.parsing.BeanComponentDefinition;
21-
import org.springframework.beans.factory.parsing.ComponentRegistrar;
22-
import org.springframework.beans.factory.parsing.ComponentRegistrarAdapter;
2323
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
2424
import org.springframework.beans.factory.xml.ParserContext;
25-
import org.w3c.dom.Element;
2625

2726
/**
2827
* Utility class for handling registration of auto-proxy creators used internally
@@ -53,41 +52,22 @@ public abstract class AopNamespaceUtils {
5352
private static final String EXPOSE_PROXY_ATTRIBUTE = "expose-proxy";
5453

5554

56-
/**
57-
* @deprecated since Spring 3.1 in favor of
58-
* {@link #registerAutoProxyCreatorIfNecessary(BeanDefinitionRegistry, ComponentRegistrar, Object, Boolean, Boolean)}
59-
*/
60-
@Deprecated
6155
public static void registerAutoProxyCreatorIfNecessary(
6256
ParserContext parserContext, Element sourceElement) {
6357

6458
BeanDefinition beanDefinition = AopConfigUtils.registerAutoProxyCreatorIfNecessary(
6559
parserContext.getRegistry(), parserContext.extractSource(sourceElement));
6660
useClassProxyingIfNecessary(parserContext.getRegistry(), sourceElement);
67-
registerComponentIfNecessary(beanDefinition, new ComponentRegistrarAdapter(parserContext));
68-
}
69-
70-
public static void registerAutoProxyCreatorIfNecessary(
71-
BeanDefinitionRegistry registry, ComponentRegistrar parserContext, Object source, Boolean proxyTargetClass, Boolean exposeProxy) {
72-
73-
BeanDefinition beanDefinition =
74-
AopConfigUtils.registerAutoProxyCreatorIfNecessary(registry, source);
75-
useClassProxyingIfNecessary(registry, proxyTargetClass, exposeProxy);
7661
registerComponentIfNecessary(beanDefinition, parserContext);
7762
}
7863

79-
public static void registerAutoProxyCreatorIfNecessary(
80-
BeanDefinitionRegistry registry, ComponentRegistrar parserContext, Object source, Boolean proxyTargetClass) {
81-
registerAutoProxyCreatorIfNecessary(registry, parserContext, source, proxyTargetClass, false);
82-
}
83-
8464
public static void registerAspectJAutoProxyCreatorIfNecessary(
8565
ParserContext parserContext, Element sourceElement) {
8666

8767
BeanDefinition beanDefinition = AopConfigUtils.registerAspectJAutoProxyCreatorIfNecessary(
8868
parserContext.getRegistry(), parserContext.extractSource(sourceElement));
8969
useClassProxyingIfNecessary(parserContext.getRegistry(), sourceElement);
90-
registerComponentIfNecessary(beanDefinition, new ComponentRegistrarAdapter(parserContext));
70+
registerComponentIfNecessary(beanDefinition, parserContext);
9171
}
9272

9373
public static void registerAspectJAnnotationAutoProxyCreatorIfNecessary(
@@ -96,7 +76,7 @@ public static void registerAspectJAnnotationAutoProxyCreatorIfNecessary(
9676
BeanDefinition beanDefinition = AopConfigUtils.registerAspectJAnnotationAutoProxyCreatorIfNecessary(
9777
parserContext.getRegistry(), parserContext.extractSource(sourceElement));
9878
useClassProxyingIfNecessary(parserContext.getRegistry(), sourceElement);
99-
registerComponentIfNecessary(beanDefinition, new ComponentRegistrarAdapter(parserContext));
79+
registerComponentIfNecessary(beanDefinition, parserContext);
10080
}
10181

10282
/**
@@ -108,7 +88,7 @@ public static void registerAspectJAnnotationAutoProxyCreatorIfNecessary(
10888
public static void registerAutoProxyCreatorIfNecessary(ParserContext parserContext, Object source) {
10989
BeanDefinition beanDefinition = AopConfigUtils.registerAutoProxyCreatorIfNecessary(
11090
parserContext.getRegistry(), source);
111-
registerComponentIfNecessary(beanDefinition, new ComponentRegistrarAdapter(parserContext));
91+
registerComponentIfNecessary(beanDefinition, parserContext);
11292
}
11393

11494
/**
@@ -121,12 +101,6 @@ public static void forceAutoProxyCreatorToUseClassProxying(BeanDefinitionRegistr
121101
}
122102

123103

124-
/**
125-
* @deprecated since Spring 3.1 in favor of
126-
* {@link #useClassProxyingIfNecessary(BeanDefinitionRegistry, Boolean, Boolean)}
127-
* which does not require a parameter of type org.w3c.dom.Element
128-
*/
129-
@Deprecated
130104
private static void useClassProxyingIfNecessary(BeanDefinitionRegistry registry, Element sourceElement) {
131105
if (sourceElement != null) {
132106
boolean proxyTargetClass = Boolean.valueOf(sourceElement.getAttribute(PROXY_TARGET_CLASS_ATTRIBUTE));
@@ -140,20 +114,11 @@ private static void useClassProxyingIfNecessary(BeanDefinitionRegistry registry,
140114
}
141115
}
142116

143-
private static void useClassProxyingIfNecessary(BeanDefinitionRegistry registry, Boolean proxyTargetClass, Boolean exposeProxy) {
144-
if (proxyTargetClass) {
145-
AopConfigUtils.forceAutoProxyCreatorToUseClassProxying(registry);
146-
}
147-
if (exposeProxy) {
148-
AopConfigUtils.forceAutoProxyCreatorToExposeProxy(registry);
149-
}
150-
}
151-
152-
private static void registerComponentIfNecessary(BeanDefinition beanDefinition, ComponentRegistrar componentRegistrar) {
117+
private static void registerComponentIfNecessary(BeanDefinition beanDefinition, ParserContext parserContext) {
153118
if (beanDefinition != null) {
154119
BeanComponentDefinition componentDefinition =
155120
new BeanComponentDefinition(beanDefinition, AopConfigUtils.AUTO_PROXY_CREATOR_BEAN_NAME);
156-
componentRegistrar.registerComponent(componentDefinition);
121+
parserContext.registerComponent(componentDefinition);
157122
}
158123
}
159124

org.springframework.beans/src/main/java/org/springframework/beans/factory/parsing/ComponentRegistrar.java

Lines changed: 0 additions & 35 deletions
This file was deleted.

org.springframework.beans/src/main/java/org/springframework/beans/factory/parsing/ComponentRegistrarAdapter.java

Lines changed: 0 additions & 55 deletions
This file was deleted.

org.springframework.beans/src/main/java/org/springframework/beans/factory/parsing/ProblemCollector.java

Lines changed: 0 additions & 35 deletions
This file was deleted.

org.springframework.beans/src/main/java/org/springframework/beans/factory/parsing/SimpleProblemCollector.java

Lines changed: 0 additions & 59 deletions
This file was deleted.

org.springframework.beans/src/main/java/org/springframework/beans/factory/xml/BeanDefinitionParser.java

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,27 +22,18 @@
2222

2323
/**
2424
* Interface used by the {@link DefaultBeanDefinitionDocumentReader} to handle custom,
25-
* top-level (directly under {@code <beans>}) tags.
25+
* top-level (directly under {@code <beans/>}) tags.
2626
*
2727
* <p>Implementations are free to turn the metadata in the custom tag into as many
2828
* {@link BeanDefinition BeanDefinitions} as required.
2929
*
3030
* <p>The parser locates a {@link BeanDefinitionParser} from the associated
3131
* {@link NamespaceHandler} for the namespace in which the custom tag resides.
3232
*
33-
* <p>Implementations are encouraged to decouple XML parsing from bean registration by
34-
* parsing element(s) into a {@link org.springframework.context.FeatureSpecification
35-
* FeatureSpecification} object and subsequently executing that specification.
36-
* Doing so allows for maximum reuse between XML-based and annotation-based
37-
* configuration options.
38-
*
3933
* @author Rob Harrop
4034
* @since 2.0
4135
* @see NamespaceHandler
4236
* @see AbstractBeanDefinitionParser
43-
* @see org.springframework.beans.factory.xml.BeanDefinitionDecorator
44-
* @see org.springframework.context.FeatureSpecification
45-
* @see org.springframework.context.AbstractSpecificationExecutor
4637
*/
4738
public interface BeanDefinitionParser {
4839

@@ -53,12 +44,11 @@ public interface BeanDefinitionParser {
5344
* embedded in the supplied {@link ParserContext}.
5445
* <p>Implementations must return the primary {@link BeanDefinition} that results
5546
* from the parse if they will ever be used in a nested fashion (for example as
56-
* an inner tag in a <code>&lt;property/&gt;</code> tag). Implementations may return
57-
* <code>null</code> if they will <strong>not</strong> be used in a nested fashion.
47+
* an inner tag in a {@code <property/>} tag). Implementations may return
48+
* {@code null} if they will <strong>not</strong> be used in a nested fashion.
5849
* @param element the element that is to be parsed into one or more {@link BeanDefinition BeanDefinitions}
5950
* @param parserContext the object encapsulating the current state of the parsing process;
60-
* provides access to a {@link org.springframework.beans.factory.support.BeanDefinitionRegistry
61-
* BeanDefinitionRegistry}.
51+
* provides access to a {@link org.springframework.beans.factory.support.BeanDefinitionRegistry}
6252
* @return the primary {@link BeanDefinition}
6353
*/
6454
BeanDefinition parse(Element element, ParserContext parserContext);

org.springframework.context/.springBeans

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<beansProjectDescription>
33
<version>1</version>
4-
<pluginVersion><![CDATA[2.5.0.201008272200-CI-R3822-B852]]></pluginVersion>
4+
<pluginVersion><![CDATA[2.6.0.201103160035-RELEASE]]></pluginVersion>
55
<configSuffixes>
66
<configSuffix><![CDATA[xml]]></configSuffix>
77
</configSuffixes>
@@ -11,7 +11,6 @@
1111
<config>src/test/java/org/springframework/context/annotation/configuration/SecondLevelSubConfig-context.xml</config>
1212
<config>src/test/java/org/springframework/context/annotation/configuration/ImportXmlWithAopNamespace-context.xml</config>
1313
<config>src/test/java/org/springframework/context/annotation/Spr6602Tests-context.xml</config>
14-
<config>src/test/java/org/springframework/context/annotation/FeatureConfigurationImportResourceTests-context.xml</config>
1514
</configs>
1615
<configSets>
1716
</configSets>

0 commit comments

Comments
 (0)