
springboot
我不是攻城狮
越努力越幸运
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
spring @Profile
xxx。原创 2025-01-07 18:02:24 · 93 阅读 · 0 评论 -
BeanFactory、FactroyBean、ApplicationContext
定制的工厂Bean,可以通过抽象工厂方式创建的bean,不纳入spring的生命周期、依赖、注入特性,相当于spring给第三方的一个扩展,比如dubbo的@DubboReference,ReferenceBean交给dubbo ioc自己管理。实现BeanFactory接口,全局上下文,非spring自动注入但加入spring管理的bean,刷新生命周期的时候调用的工厂直接就是ApplicationContext,通过ApplicationContext一样可以刷新容器。原创 2024-05-26 18:03:49 · 247 阅读 · 0 评论 -
spring自定义初始化的加载顺序
构造函数>@PostConstruct > afterPropertiesSet > init-method。原创 2024-05-26 17:41:15 · 544 阅读 · 0 评论 -
@Service 、@Component、@Repository
xxxx。原创 2024-05-26 17:37:27 · 391 阅读 · 0 评论 -
springboot/spring事务传播机制
spring事务传播机制原创 2019-11-22 10:23:21 · 568 阅读 · 1 评论 -
spring refresh
负责spring ioc、proxy 、aop 、init、event的整合。原创 2024-05-26 13:38:24 · 418 阅读 · 0 评论 -
aop(spring 和 springboot)
springaop源码级别解析原创 2022-12-28 17:51:43 · 540 阅读 · 1 评论 -
springboot内置Tomcat流程
加载了org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext。ServletWebServerApplicationContext继承AbstractApplicationContext,并且重新实现了onRefresh方法。2、spring refresh 中onRefresh回调中启动了内置Tomcat。原创 2023-11-22 19:00:43 · 880 阅读 · 0 评论 -
springboot启动
2、确认入口类之后,就是SpringApplication.run(XXXXApplication.class, args);1、SpringApplication new一个对象会优先调用initialize方法。原创 2023-11-22 15:43:25 · 284 阅读 · 0 评论 -
springboot/spring事务
使用spring proxy和aop来执行事务,发生在finishBeanFactoryInitialization阶段。ProxyTransactionManagementConfiguration:提供aop能力,解析事务注解。AutoProxyRegistrar:提供proxy;将事务注解转化为BD。2-1、执行前置增强(根据事务传播机制来实现事务的开启提交回滚)2-2、执行后置增强(根据事务传播机制来实现事务的开启提交回滚)2-3、实现事务的开启提交回滚(aop)springboot启动。原创 2020-03-09 17:25:31 · 373 阅读 · 1 评论 -
springboot自动装配过程
3、 在spring刷新阶段提前导入在spring.factories中需要自动装配的配置类,使用@EnableAutoConfiguration的自动配置类为org.springframework.boot.autoconfigure.EnableAutoConfiguration,其他比如redis、rabitmq、roketmq等默认的配置类都在这里反射实现。2、 解析@ComponentScan标注的Bean类、方法解析到内存,从候选者转化为BD。原创 2020-03-30 15:29:44 · 820 阅读 · 1 评论