|
|
|
@ -52,7 +52,7 @@ public @interface EnableAutoConfiguration {
|
|
|
|
|
|
|
|
|
|
- 类图
|
|
|
|
|
|
|
|
|
|
![image-20200320150642022](/images/SpringBoot/image-20200320150642022.png)
|
|
|
|
|
![image-20200320150642022](../../../images/SpringBoot/image-20200320150642022.png)
|
|
|
|
|
|
|
|
|
|
## getAutoConfigurationMetadata()
|
|
|
|
|
|
|
|
|
@ -106,7 +106,7 @@ public @interface EnableAutoConfiguration {
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
![image-20200320160423991](/images/SpringBoot/image-20200320160423991.png)
|
|
|
|
|
![image-20200320160423991](../../../images/SpringBoot/image-20200320160423991.png)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -138,11 +138,11 @@ public @interface EnableAutoConfiguration {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
![image-20200320162835665](/images/SpringBoot/image-20200320162835665.png)
|
|
|
|
|
![image-20200320162835665](../../../images/SpringBoot/image-20200320162835665.png)
|
|
|
|
|
|
|
|
|
|
同样找一下redis
|
|
|
|
|
|
|
|
|
|
![image-20200320163001728](/images/SpringBoot/image-20200320163001728.png)
|
|
|
|
|
![image-20200320163001728](../../../images/SpringBoot/image-20200320163001728.png)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -236,13 +236,13 @@ public class RedisProperties {
|
|
|
|
|
|
|
|
|
|
- `org.springframework.boot.autoconfigure.AutoConfigurationImportSelector.AutoConfigurationGroup#process`
|
|
|
|
|
|
|
|
|
|
![image-20200320163806852](/images/SpringBoot/image-20200320163806852.png)
|
|
|
|
|
![image-20200320163806852](../../../images/SpringBoot/image-20200320163806852.png)
|
|
|
|
|
|
|
|
|
|
再此之前我们看过了`getAutoConfigurationMetadata()`的相关操作
|
|
|
|
|
|
|
|
|
|
关注 `AnnotationMetadata annotationMetadata` 存储了一些什么
|
|
|
|
|
|
|
|
|
|
![image-20200320164145286](/images/SpringBoot/image-20200320164145286.png)
|
|
|
|
|
![image-20200320164145286](../../../images/SpringBoot/image-20200320164145286.png)
|
|
|
|
|
|
|
|
|
|
这里简单理解
|
|
|
|
|
|
|
|
|
@ -304,7 +304,7 @@ public class RedisProperties {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
![image-20200320171138431](/images/SpringBoot/image-20200320171138431.png)
|
|
|
|
|
![image-20200320171138431](../../../images/SpringBoot/image-20200320171138431.png)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -324,7 +324,7 @@ public class RedisProperties {
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
![image-20200320171734270](/images/SpringBoot/image-20200320171734270.png)
|
|
|
|
|
![image-20200320171734270](../../../images/SpringBoot/image-20200320171734270.png)
|
|
|
|
|
|
|
|
|
|
- 第一个是我自己写的一个测试用
|
|
|
|
|
|
|
|
|
@ -390,7 +390,7 @@ public class RedisProperties {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
![image-20200323080611527](/images/SpringBoot/image-20200323080611527.png)
|
|
|
|
|
![image-20200323080611527](../../../images/SpringBoot/image-20200323080611527.png)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -401,7 +401,7 @@ public class RedisProperties {
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
![image-20200323081009823](/images/SpringBoot/image-20200323081009823.png)
|
|
|
|
|
![image-20200323081009823](../../../images/SpringBoot/image-20200323081009823.png)
|
|
|
|
|
|
|
|
|
|
### checkExcludedClasses
|
|
|
|
|
|
|
|
|
@ -477,7 +477,7 @@ public class RedisProperties {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
![image-20200323081903145](/images/SpringBoot/image-20200323081903145.png)
|
|
|
|
|
![image-20200323081903145](../../../images/SpringBoot/image-20200323081903145.png)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -493,7 +493,7 @@ public class RedisProperties {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
![image-20200323082553595](/images/SpringBoot/image-20200323082553595.png)
|
|
|
|
|
![image-20200323082553595](../../../images/SpringBoot/image-20200323082553595.png)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -521,13 +521,13 @@ public class RedisProperties {
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
![image-20200323083149737](/images/SpringBoot/image-20200323083149737.png)
|
|
|
|
|
![image-20200323083149737](../../../images/SpringBoot/image-20200323083149737.png)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- `AutoConfigurationImportEvent event = new AutoConfigurationImportEvent(this, configurations, exclusions);`
|
|
|
|
|
|
|
|
|
|
![image-20200323083247061](/images/SpringBoot/image-20200323083247061.png)
|
|
|
|
|
![image-20200323083247061](../../../images/SpringBoot/image-20200323083247061.png)
|
|
|
|
|
|
|
|
|
|
- `org.springframework.boot.autoconfigure.AutoConfigurationImportListener#onAutoConfigurationImportEvent` 在执行自动配置时触发 , 实现类只有 **`ConditionEvaluationReportAutoConfigurationImportListener`**
|
|
|
|
|
|
|
|
|
@ -547,7 +547,7 @@ public class RedisProperties {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
![image-20200323083656670](/images/SpringBoot/image-20200323083656670.png)
|
|
|
|
|
![image-20200323083656670](../../../images/SpringBoot/image-20200323083656670.png)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -565,7 +565,7 @@ public class RedisProperties {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
![image-20200323084922159](/images/SpringBoot/image-20200323084922159.png)
|
|
|
|
|
![image-20200323084922159](../../../images/SpringBoot/image-20200323084922159.png)
|
|
|
|
|
|
|
|
|
|
- 后续的一些行为相对简单,直接放个源码了.
|
|
|
|
|
|
|
|
|
|