提交 5327a7a3 编写于 作者: C Chris Beams

Fix package cycle in @EnableSpringConfigured

@EnableSpringConfigured and its @Import'ed
SpringConfiguredConfiguration @Configuration class inadvertently
established a package cycle between beans.factory.aspectj and
context.annotation due to SpringConfiguredConfiguration's
dependency on annotations such as @Configuration, @Bean and @Role.

This commit fixes this architecture bug by moving
@EnableSpringConfigured and SpringConfiguredConfiguration from the
beans.factory.aspectj package to the context.annotation package where
they belong.

This change is assumed to be very low impact as @EnableSpringConfigured
was introduced in 3.1.0 and relocation is happening as quickly as
possible in 3.1.2. @EnableSpringConfigured is assumed to be infrequently
used at this point, and for those that are the migration path
is straightforward. When upgrading from Spring 3.1.0 or 3.1.1, update
import statements in any affected @Configuration classes to reflect the
new packaging.

Issue: SPR-9441
上级 a4b00c73
/*
* Copyright 2002-2011 the original author or authors.
* Copyright 2002-2012 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.
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.beans.factory.aspectj;
package org.springframework.context.annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
......@@ -25,14 +25,16 @@ import java.lang.annotation.Target;
import org.springframework.context.annotation.Import;
/**
* Signals the current application context to apply dependency injection to non-managed
* classes that are instantiated outside of the Spring bean factory (typically classes
* annotated with the @{@link org.springframework.beans.factory.annotation.Configurable
* Signals the current application context to apply dependency injection to
* non-managed classes that are instantiated outside of the Spring bean factory
* (typically classes annotated with the @
* {@link org.springframework.beans.factory.annotation.Configurable
* Configurable} annotation).
*
* <p>Similar to functionality found in Spring's {@code <context:spring-configured>} XML
* element. Often used in conjunction with {@link
* org.springframework.context.annotation.EnableLoadTimeWeaving @EnableLoadTimeWeaving}.
* <p>Similar to functionality found in Spring's
* {@code <context:spring-configured>} XML element. Often used in conjunction
* with {@link org.springframework.context.annotation.EnableLoadTimeWeaving
* @EnableLoadTimeWeaving}.
*
* @author Chris Beams
* @since 3.1
......
/*
* Copyright 2002-2011 the original author or authors.
* Copyright 2002-2012 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.
......@@ -14,8 +14,9 @@
* limitations under the License.
*/
package org.springframework.beans.factory.aspectj;
package org.springframework.context.annotation;
import org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
......
/*
* Copyright 2002-2011 the original author or authors.
* Copyright 2002-2012 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.
......@@ -14,16 +14,15 @@
* limitations under the License.
*/
package org.springframework.beans.factory.aspectj;
package org.springframework.context.annotation;
import org.springframework.beans.factory.aspectj.AbstractBeanConfigurerTests;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;
/**
* Tests that @EnableSpringConfigured properly registers an
* {@link AnnotationBeanConfigurerAspect}, just as does {@code <context:spring-configured>}
* {@link org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect}, just
* as does {@code <context:spring-configured>}
*
* @author Chris Beams
* @since 3.1
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册