Spring这个框架相当于说我们做JAVA服务端开发的人员是必备的框架,那么在面试的时候Spring也是无法逃脱的,说到Spring那么就不得不提IOC和AOP,往往我们分析Spring的源码的时候都是直接切入refresh()方法,而忽略了一些其他的细节,当然refresh()方法也很重要,那么本文作文Spring整个框架源码分析的一个聚合,不单是只分析refresh()方法中调用的方法,还会分析整个Spring启动的过程!
环境准备本文代码环境基于Spring5.1.5,基本依赖如下
依赖准备
org.springframework spring-context 5.1.5.RELEASE org.springframework spring-webmvc 5.1.5.RELEASE org.springframework spring-aspects 5.1.5.RELEASE
代码准备
@Service
public class A {
public Integer f(){
System.out.println("我被执行了");
return 1;
}
}
public static void main(String[] args) {
ApplicationContext factory = new AnnotationConfigApplicationContext(TestMain.class);
A a1 = (A) factory.getBean(A.class);
a1.f();
}
源码分析


