系列八、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
相关推荐
budingxiaomoli4 小时前
Spring IoC &DI
java·spring·ioc·di
Spider Cat 蜘蛛猫4 小时前
Springboot SSO系统设计文档
java·spring boot·后端
未若君雅裁5 小时前
MySQL高可用与扩展-主从复制读写分离分库分表
java·数据库·mysql
学习中.........5 小时前
从扰动函数的变化,感受红黑树带来的性能提升
java
计算机安禾5 小时前
【c++面向对象编程】第24篇:类型转换运算符:自定义隐式转换与explicit
java·c++·算法
zyk_computer6 小时前
AI 时代,或许 Rust 比 Python 更合适
人工智能·后端·python·ai·rust·ai编程·vibe coding
weixin199701080166 小时前
【保姆级教程】淘宝/天猫商品详情 API(item_get)接入指南:Python/Java/PHP 调用示例与 JSON 返回值解析
java·python·php
环流_6 小时前
redis核心数据类型在java中的操作
java·数据库·redis
雨辰AI6 小时前
SpringBoot3 项目国产化改造完整流程|从 MySQL 到人大金仓落地
java·数据库·后端·mysql·政务
带刺的坐椅6 小时前
Java 流程编排新范式 Solon Flow:一个引擎,七种节点,覆盖规则/任务/工作流/AI 编排全场景
java·spring·ai·solon·flow