Spring源码分析
一、Spring依赖注入有三种实现方式:
1.构造器注入
2.Setter注入
3.FactoryBean接口注入
二、Spring三种配置方式:
1.XML
2.注解
3.Java的配置
三、Spring初始化过程:
1.初始化beanFactory,加载BeanDefinition的核心类和方法
2.初始化bean一个普通分支
3.Aop的实现原理
这个在getBean里面的AbstractAutowireCapableBeanFactory.initializeBean();里面发挥用处
JDK动态代理是需要被代理的类实现InvocationHandler接口,JDK动态代理只能对实现了接口的类生成代理,而不能针对类。
CGLIB是针对类实现代理,主要是对指定的类生成一个子类,覆盖其中的方法,并覆盖其中方法实现增强,但是因为采用的是继承,所以该类或方法最好不要声明成final,对于final类或方法,是无法继承的。