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