001/*
002 * Copyright 2002-2018 the original author or authors.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *      https://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016
017package org.springframework.context.annotation.aspectj;
018
019import org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect;
020import org.springframework.beans.factory.config.BeanDefinition;
021import org.springframework.context.annotation.Bean;
022import org.springframework.context.annotation.Configuration;
023import org.springframework.context.annotation.Role;
024
025/**
026 * {@code @Configuration} class that registers an {@code AnnotationBeanConfigurerAspect}
027 * capable of performing dependency injection services for non-Spring managed objects
028 * annotated with @{@link org.springframework.beans.factory.annotation.Configurable
029 * Configurable}.
030 *
031 * <p>This configuration class is automatically imported when using the
032 * {@link EnableSpringConfigured @EnableSpringConfigured} annotation. See
033 * {@code @EnableSpringConfigured}'s javadoc for complete usage details.
034 *
035 * @author Chris Beams
036 * @since 3.1
037 * @see EnableSpringConfigured
038 */
039@Configuration
040public class SpringConfiguredConfiguration {
041
042        /**
043         * The bean name used for the configurer aspect.
044         */
045        public static final String BEAN_CONFIGURER_ASPECT_BEAN_NAME =
046                        "org.springframework.context.config.internalBeanConfigurerAspect";
047
048        @Bean(name = BEAN_CONFIGURER_ASPECT_BEAN_NAME)
049        @Role(BeanDefinition.ROLE_INFRASTRUCTURE)
050        public AnnotationBeanConfigurerAspect beanConfigurerAspect() {
051                return AnnotationBeanConfigurerAspect.aspectOf();
052        }
053
054}