@Configuration
//@Configuration
@ComponentScan("com.google")
@Import(MyBean.class)
public class AppConfig {
}
//=======================================================================================
public class Test {
public static void main(String[] args) {
AnnotationConfigApplicationContext ac = new AnnotationConfigApplicationContext();
ac.register(AppConfig.class);
ac.refresh();
AppConfig appConfig = ac.getBean(AppConfig.class);
}
}
PostProcessorRegistrationDelegate
#invokeBeanFactoryPostProcessors()
ConfigurationClassPostProcessor
#postProcessBeanFactory()
ConfigurationClassPostProcessor
#enhanceConfigurationClasses()
执行到最后AppConfig如下
当我们给AppConfig加上@Configuration注解之后,再来看这个过程
执行到最后我们来看拿出来的这个AppConfig