![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
springboot
文章平均质量分 95
路人丁.
这个作者很懒,什么都没留下…
展开
-
Spring AOP名词解释Advice,Pointcut,Advisor,Joinpoint,Advised是什么?
Adviceadvice解释为通知,需要执行的增强逻辑方法。advice规范接口如图,分为了before,after等等,为什么没有around呢,因为是通过interceptor实现的。这里可以看出,AfterAdvice最终会被转换包装成MethodBeforeAdviceInterceptor实现类进行适配桥接,同理BeforeAdvice也会被包装成MethodBeforeAdviceInterceptor最终调用MethodIntercepter#invoke()方法进行适配。原创 2021-10-22 23:14:47 · 3321 阅读 · 2 评论 -
初步理解springboot的 @EnableAutoConfiguration注解
问题:为什么我们在springboot的入口类上加上@SpringBootApplication注解就能启动一个spring容器?1.首先看看该注解的源码:@Target(ElementType.TYPE)@Retention(RetentionPolicy.RUNTIME)@Documented@Inherited@SpringBootConfiguration@Enable...原创 2019-07-06 16:55:29 · 398 阅读 · 0 评论 -
自定义Springboot @EnableXXX注解
上一篇大概讲了springboot 的@EnableAutoConfiguration的实现,这篇我们自定义一个@EnableMyCache注解实现。1.利用@Import注解加载不在包扫描范围的类,并将其注册到容器。2.我们知道将Bean注册到IOC容器有很多种方式,从最初的使用XML配置文件的<bean/>标签,到使用注解@Component或@ManagedBean及其派...原创 2019-07-06 17:24:27 · 696 阅读 · 0 评论 -
springboot的starter解析
首先明确:starter是一种集成(自动装配)starter命名规则: spring-boot-starter-{name} {name}-spring-boot-starter [mybatis-spring-boot-starter]自定义一个格式化组件(类似于RestTemplate)://接口及两个实现类package org.demo.starte...原创 2019-07-06 22:52:26 · 161 阅读 · 0 评论