Enable注解是如何实现的?
当我们使用Spring Boot的时候,只需要在启动类上加@SpringBootApplication注解即可,非常方便。@SpringBootApplication是一个复合注解
@SpringBootConfiguration
@EnableAutoConfiguration
@ComponentScan
其中自动装配的功能就是由@EnableAutoConfiguration注解实现的,那么@EnableAutoConfiguration是如何实现这个神奇的功能的?
我们先从Enable注解是如何是如何实现的开始聊起
在使用Spring的时候,我们只需要一个Enable注解就能实现开启一个模块的功能,非常的方便,那么这个功能是如何实现的?
我们常用的Enable注解如下所示
| 注解 | 作用 |
|---|---|
| @EnableAspectJAutoProxy | 开启AspectJ自动代理 |
| @EnableAsync | 开启异步方法支 |
本文标题:手写单点登陆starter:Spring Boot 自动装配是如何实现的?
本文链接:https://blog.quwenai.cn/post/8800.html
版权声明:本文不使用任何协议授权,您可以任何形式自由转载或使用。







还没有评论,来说两句吧...