We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4a4378d commit 1f29c17Copy full SHA for 1f29c17
1 file changed
docs/system-design/framework/spring/spring-knowledge-and-questions-summary.md
@@ -486,8 +486,8 @@ public class UserThreadLocal {
486
487
### ⭐️Bean 的生命周期了解么?
488
489
-1. **创建 Bean 的实例**:Bean 容器首先会找到配置文件中的 Bean 定义,然后使用 Java 反射 API 来创建 Bean 的实例。
490
-2. **Bean 属性赋值/填充**:为 Bean 设置相关属性和依赖,例如`@Autowired` 等注解注入的对象、`@Value` 注入的值、`setter`方法或构造函数注入依赖和值、`@Resource`注入的各种资源。
+1. **创建 Bean 的实例**:Bean 容器首先会找到配置文件中的 Bean 定义,然后选用适当的实例化策略(工厂方法、构造函数自动装配或者简单实例化)通过 Java 反射 API 来创建 Bean 的实例。
+2. **Bean 属性赋值/填充**:为 Bean 设置相关属性和依赖,例如处理标记在字段或 Setter 方法上的 `@Autowired`、`@Value`、`@Resource` 等注解。
491
3. **Bean 初始化**:
492
- 如果 Bean 实现了 `BeanNameAware` 接口,调用 `setBeanName()`方法,传入 Bean 的名字。
493
- 如果 Bean 实现了 `BeanClassLoaderAware` 接口,调用 `setBeanClassLoader()`方法,传入 `ClassLoader`对象的实例。
0 commit comments