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
This commit is contained in:
Chris Beams
2011-05-06 19:03:52 +00:00
parent 0a790c143f
commit 111fb71fe1
80 changed files with 857 additions and 6737 deletions

View File

@@ -1,35 +0,0 @@
/*
* Copyright 2002-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.beans.factory.parsing;
import org.springframework.beans.factory.config.BeanDefinition;
/**
* TODO SPR-7420: document
*
* @author Chris Beams
* @since 3.1
*/
public interface ComponentRegistrar {
String registerWithGeneratedName(BeanDefinition beanDefinition);
void registerBeanComponent(BeanComponentDefinition component);
void registerComponent(ComponentDefinition component);
}

View File

@@ -1,55 +0,0 @@
/*
* Copyright 2002-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.beans.factory.parsing;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.xml.ParserContext;
/**
* TODO SPR-7420: document
* <p>Adapter is necessary as opposed to having ParserContext
* implement ComponentRegistrar directly due to tooling issues.
* STS may ship with a version of Spring older that 3.1 (when
* this type was introduced), and will run into
* IncompatibleClassChangeErrors when it's (3.0.5) ParserContext
* tries to mix with our (3.1.0) BeanDefinitionParser
* (and related) infrastructure.
*
* @author Chris Beams
* @since 3.1
*/
public class ComponentRegistrarAdapter implements ComponentRegistrar {
private final ParserContext parserContext;
public ComponentRegistrarAdapter(ParserContext parserContext) {
this.parserContext = parserContext;
}
public String registerWithGeneratedName(BeanDefinition beanDefinition) {
return this.parserContext.getReaderContext().registerWithGeneratedName(beanDefinition);
}
public void registerBeanComponent(BeanComponentDefinition component) {
this.parserContext.registerBeanComponent(component);
}
public void registerComponent(ComponentDefinition component) {
this.parserContext.registerComponent(component);
}
}

View File

@@ -1,35 +0,0 @@
/*
* Copyright 2002-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.beans.factory.parsing;
/**
* TODO SPR-7420: document
*
* @author Chris Beams
* @since 3.1
*/
public interface ProblemCollector {
void error(String message);
void error(String message, Throwable cause);
void reportProblems(ProblemReporter reporter);
boolean hasErrors();
}

View File

@@ -1,59 +0,0 @@
/*
* Copyright 2002-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.beans.factory.parsing;
import java.util.ArrayList;
import java.util.List;
import org.springframework.core.io.DescriptiveResource;
/**
* TODO SPR-7420: document
*
* @author Chris Beams
* @since 3.1
*/
public class SimpleProblemCollector implements ProblemCollector {
private Location location = null;
private List<Problem> errors = new ArrayList<Problem>();
public SimpleProblemCollector(Object location) {
if (location != null) {
this.location = new Location(new DescriptiveResource(location.toString()));
}
}
public void error(String message) {
this.errors.add(new Problem(message, this.location));
}
public void error(String message, Throwable cause) {
this.errors.add(new Problem(message, this.location, null, cause));
}
public void reportProblems(ProblemReporter reporter) {
for (Problem error : errors) {
reporter.error(error);
}
}
public boolean hasErrors() {
return this.errors.size() > 0;
}
}

View File

@@ -22,7 +22,7 @@ import org.springframework.beans.factory.config.BeanDefinition;
/**
* Interface used by the {@link DefaultBeanDefinitionDocumentReader} to handle custom,
* top-level (directly under {@code <beans>}) tags.
* top-level (directly under {@code <beans/>}) tags.
*
* <p>Implementations are free to turn the metadata in the custom tag into as many
* {@link BeanDefinition BeanDefinitions} as required.
@@ -30,19 +30,10 @@ import org.springframework.beans.factory.config.BeanDefinition;
* <p>The parser locates a {@link BeanDefinitionParser} from the associated
* {@link NamespaceHandler} for the namespace in which the custom tag resides.
*
* <p>Implementations are encouraged to decouple XML parsing from bean registration by
* parsing element(s) into a {@link org.springframework.context.FeatureSpecification
* FeatureSpecification} object and subsequently executing that specification.
* Doing so allows for maximum reuse between XML-based and annotation-based
* configuration options.
*
* @author Rob Harrop
* @since 2.0
* @see NamespaceHandler
* @see AbstractBeanDefinitionParser
* @see org.springframework.beans.factory.xml.BeanDefinitionDecorator
* @see org.springframework.context.FeatureSpecification
* @see org.springframework.context.AbstractSpecificationExecutor
*/
public interface BeanDefinitionParser {
@@ -53,12 +44,11 @@ public interface BeanDefinitionParser {
* embedded in the supplied {@link ParserContext}.
* <p>Implementations must return the primary {@link BeanDefinition} that results
* from the parse if they will ever be used in a nested fashion (for example as
* an inner tag in a <code>&lt;property/&gt;</code> tag). Implementations may return
* <code>null</code> if they will <strong>not</strong> be used in a nested fashion.
* an inner tag in a {@code <property/>} tag). Implementations may return
* {@code null} if they will <strong>not</strong> be used in a nested fashion.
* @param element the element that is to be parsed into one or more {@link BeanDefinition BeanDefinitions}
* @param parserContext the object encapsulating the current state of the parsing process;
* provides access to a {@link org.springframework.beans.factory.support.BeanDefinitionRegistry
* BeanDefinitionRegistry}.
* provides access to a {@link org.springframework.beans.factory.support.BeanDefinitionRegistry}
* @return the primary {@link BeanDefinition}
*/
BeanDefinition parse(Element element, ParserContext parserContext);