摘要: 先看一个例子,增强 spring bean 的方法,使用 JDK 动态代理的方式 @Component public class Test implements BeanPostProcessor, ApplicationContextAware { private ApplicationConte 阅读全文
posted @ 2024-06-29 18:35 CyrusHuang 阅读(3) 评论(0) 推荐(0) 编辑
摘要: BeanFactoryPostProcessor 触发时机是:**所有的 beanDefinition 收集完成,将要进行对象实例化的阶段,这时可以修改 beanDefinition 或 新增 beanDefinition ** BeanFactoryPostProcessor 是个函数式接口,接口 阅读全文
posted @ 2024-06-29 18:33 CyrusHuang 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 占坑 阅读全文
posted @ 2024-06-29 18:08 CyrusHuang 阅读(2) 评论(0) 推荐(0) 编辑
摘要: bean 的创建过程 读取配置文件,解析配置文件,得到 bean 定义集合 a56爆大奖在线娱乐 bean 的配置都对应一个 BeanDefinition 对象,统一放在容器的 beanFactory.beanDefinitionMap 中,是一个 map bean 工厂后置处理器 BeanFactoryPostP 阅读全文
posted @ 2024-06-29 18:05 CyrusHuang 阅读(2) 评论(0) 推荐(0) 编辑
摘要: bean 属性 <bean id = "" class = "" name = "" scope = "" lazy-init = "" init-method = "" destroy-method = "" autowire ="" depends-on = "" factory-bean = 阅读全文
posted @ 2024-06-29 16:42 CyrusHuang 阅读(2) 评论(0) 推荐(0) 编辑
摘要: spring 核心思想 IOC/DI:一个意思,IOC 是思想,DI 是实现 AOP:面向切面编程,OOP 是面向对象面呈 IOC 容器 ApplicationContext 是顶级容器。ClassPathXmlApplicationContext 是 xml 方式配置的具体容器; Annotati 阅读全文
posted @ 2024-06-29 12:10 CyrusHuang 阅读(1) 评论(0) 推荐(0) 编辑