系列八、Spring IOC有哪些扩展点,在什么时候调用

一、概述

Spring IOC的扩展点是指IOC在加载过程中,如何对即将要创建的bean进行扩展。

二、扩展点

2.1、实现BeanDefinitionRegistryPostProcessor

调用invokeBeanFactoryPostProcessors时,通过实现BeanDefinitionRegistryPostProcessor接口进行扩展。

2.2、实现BeanFactoryPostProcessor

调用invokeBeanFactoryPostProcessors时,通过实现BeanFactoryPostProcessor接口进行扩展。

2.3、初始化阶段调用xxxAware接口

2.4、生命周期回调时进行扩展

java 复制代码
a、@PostConstruct @PreDestroy
b、实现接口 InitializingBean, DisposableBean的方式
c、@Bean(initMethod = "init",destroyMethod = "destroy")的方式

2.5、案例代码

java 复制代码
spring11-interview
相关推荐
zjttsh14 分钟前
Linux下安装Redis
java
TimberWill38 分钟前
SpringBoot整合Srping Security实现权限控制
java·spring boot·后端
Renhao-Wan2 小时前
Java 算法实践(四):链表核心题型
java·数据结构·算法·链表
_codemonster3 小时前
JavaWeb开发系列(六)JSP基础
java·开发语言
万邦科技Lafite3 小时前
淘宝店铺所有商品API接口实战指南
java·数据库·mysql
jjjxxxhhh1233 小时前
【加密】-AES与对称加密
java·服务器·网络
临水逸3 小时前
飞牛fnos 2025 漏洞Java跨域URL浏览器
java·开发语言·安全·web安全
yaoxin5211233 小时前
324. Java Stream API - 实现 Collector 接口:自定义你的流式收集器
java·windows·python
H Corey3 小时前
数据结构与算法:高效编程的核心
java·开发语言·数据结构·算法
米羊1214 小时前
Struts 2 漏洞(上)
java·后端·struts