02、spring源码解析之扩展原理BeanFactoryPostProcessor和BeanDefinitionPostProcessor和ApplicationListener
一、Spring是如何发布事件的?ApplicationListener(观察者模式)1.1)自己写一个TestApplicationListener实现ApplicationListener接口,并且把该组件加入到容器中.@Configuration@ComponentScan("com.test")publicclassMainConfig{}@ComponentpublicclassTest