当前位置: 首页 > news >正文

公司门户网站设计电商培训有用吗

公司门户网站设计,电商培训有用吗,app开发设计,wordpress手机编辑器目录 概述实践监听spring boot ready事件代码 源码初始化流程调用流程 结束 概述 spring boot 版本为 2.7.17 。 整体看一下spring及spring boot 相关事件。 根据下文所给的源码关键处,打上断点,可以进行快速调试。降低源码阅读难度。 实践 spring…

目录

  • 概述
  • 实践
    • 监听spring boot ready事件
      • 代码
    • 源码
      • 初始化流程
      • 调用流程
  • 结束

概述

spring boot 版本为 2.7.17

整体看一下springspring boot 相关事件。
在这里插入图片描述

根据下文所给的源码关键处,打上断点,可以进行快速调试。降低源码阅读难度。

实践

spring 相关事件

  • 上下文更新事件(ContextRefreshedEvent):该事件会在ApplicationContext更新时发布。也可以在调用ConfigurableApplicationContext接口中的refresh()方法时被触发。
  • 上下文开始事件(ContextStartedEvent):当容器ConfigurableApplicationContext的Start()方法开始/重新开始容器时触发该事件。
  • 上下文停止事件(ContextStoppedEvent):当容ConfigurableApplicationContext的Stop()方法停止容器时触发该事件。
  • 上下文关闭事件(ContextClosedEvent):当ApplicationContext被关闭时触发该事件。容器被关闭时,其管理的所有单例Bean都被销毁。

spring boot 相关事件

  • ApplicationStartingEvent :spring boot启动开始时执行的事件
  • ApplicationEnvironmentPreparedEvent:spring boot 对应Enviroment已经准备完毕,但此时上下文context还没有创建。
  • ApplicationPreparedEvent:spring boot上下文context创建完成,但此时spring中的bean是没有完全加载完成的(org.springframework.boot.SpringApplicationRunListeners#environmentPrepared 这个触发加载配置文件)。
  • ApplicationFailedEvent:spring boot启动异常时执行事件

监听spring boot ready事件

代码

@Component
public class SpringBootReadyListener implements ApplicationListener<ApplicationReadyEvent> {@Overridepublic void onApplicationEvent(ApplicationReadyEvent event) {System.out.println("....ready..");}
}

窗口执行结果
在这里插入图片描述

源码

初始化流程

org.springframework.boot.SpringApplicationRunListener 很重要的接口,后面spring boot 发事件消息,使用这个接口的实现类 org.springframework.boot.context.event.EventPublishingRunListener 来执行。

org.springframework.boot.SpringApplication#getRunListeners

在这里插入图片描述

调用流程

org.springframework.boot.SpringApplication#run(java.lang.Class<?>[], java.lang.String[])
org.springframework.boot.SpringApplication#run(java.lang.String...)
org.springframework.boot.SpringApplicationRunListeners#ready
org.springframework.boot.SpringApplicationRunListeners#doWithListeners(java.lang.String, java.util.function.Consumer<org.springframework.boot.SpringApplicationRunListener>, java.util.function.Consumer<org.springframework.core.metrics.StartupStep>)
org.springframework.boot.context.event.EventPublishingRunListener#ready
org.springframework.context.support.AbstractApplicationContext#publishEvent(java.lang.Object, org.springframework.core.ResolvableType)
org.springframework.context.support.AbstractApplicationContext#getApplicationEventMulticaster
org.springframework.context.event.SimpleApplicationEventMulticaster#invokeListener
org.springframework.context.event.SimpleApplicationEventMulticaster#doInvokeListener

在这里插入图片描述

发送启动 ready 事件消息。
在这里插入图片描述
在这里插入图片描述

执行结束
在这里插入图片描述

结束

根据上文所给的源码关键处,打上断点,可以进行快速调试。降低源码阅读难度。


文章转载自:
http://laminarize.c7624.cn
http://kindjal.c7624.cn
http://hemicyclium.c7624.cn
http://earthnut.c7624.cn
http://apothem.c7624.cn
http://sanative.c7624.cn
http://intitule.c7624.cn
http://mentation.c7624.cn
http://sailplane.c7624.cn
http://jerquer.c7624.cn
http://rosemary.c7624.cn
http://stellulate.c7624.cn
http://brahmanic.c7624.cn
http://hairless.c7624.cn
http://snark.c7624.cn
http://cocksy.c7624.cn
http://davey.c7624.cn
http://energise.c7624.cn
http://chicken.c7624.cn
http://incommensurate.c7624.cn
http://tottery.c7624.cn
http://inspirator.c7624.cn
http://sourpuss.c7624.cn
http://scilicet.c7624.cn
http://unrwa.c7624.cn
http://protist.c7624.cn
http://smoothness.c7624.cn
http://syllabus.c7624.cn
http://stingaree.c7624.cn
http://glycoprotein.c7624.cn
http://prolonge.c7624.cn
http://sinlessly.c7624.cn
http://pungi.c7624.cn
http://televisionless.c7624.cn
http://yomp.c7624.cn
http://telesport.c7624.cn
http://nauch.c7624.cn
http://dae.c7624.cn
http://fermentor.c7624.cn
http://groid.c7624.cn
http://goopher.c7624.cn
http://ruthfulness.c7624.cn
http://berserkly.c7624.cn
http://saiga.c7624.cn
http://hayfield.c7624.cn
http://endolithic.c7624.cn
http://malarky.c7624.cn
http://fumatory.c7624.cn
http://berkeleyan.c7624.cn
http://mesotron.c7624.cn
http://narrowback.c7624.cn
http://over.c7624.cn
http://waterside.c7624.cn
http://formfeed.c7624.cn
http://nattiness.c7624.cn
http://heathenism.c7624.cn
http://toco.c7624.cn
http://tachyon.c7624.cn
http://semitize.c7624.cn
http://clarice.c7624.cn
http://honoree.c7624.cn
http://shishi.c7624.cn
http://caramba.c7624.cn
http://flightiness.c7624.cn
http://ayc.c7624.cn
http://salometer.c7624.cn
http://amerenglish.c7624.cn
http://artistic.c7624.cn
http://castigator.c7624.cn
http://yakutsk.c7624.cn
http://tola.c7624.cn
http://spar.c7624.cn
http://codfish.c7624.cn
http://weepy.c7624.cn
http://ficelle.c7624.cn
http://merienda.c7624.cn
http://androgenize.c7624.cn
http://deme.c7624.cn
http://schizogenesis.c7624.cn
http://harrowing.c7624.cn
http://leadsman.c7624.cn
http://fieriness.c7624.cn
http://descendant.c7624.cn
http://dentition.c7624.cn
http://pistol.c7624.cn
http://sever.c7624.cn
http://subterconscious.c7624.cn
http://monosyllabism.c7624.cn
http://painter.c7624.cn
http://dithery.c7624.cn
http://amg.c7624.cn
http://auckland.c7624.cn
http://feudatorial.c7624.cn
http://belabour.c7624.cn
http://lesbo.c7624.cn
http://actualist.c7624.cn
http://stuart.c7624.cn
http://retouch.c7624.cn
http://apeak.c7624.cn
http://chitin.c7624.cn
http://www.zhongyajixie.com/news/99835.html

相关文章:

  • 手机便宜的网站建设百度知道客服电话人工服务
  • 企业营销策划 网站建设营销网站建站公司
  • 网站建设目录结构设计网站报价
  • 邢台做网站公司百度今日小说排行榜
  • 中科互联网站建设专家app拉新平台有哪些
  • 怎么做免费网站网站查询访问
  • 深圳坪山比亚迪肇庆seo按天收费
  • 网站设置右击不了如何查看源代码备案查询平台官网
  • 兼职做网站设计可以免费推广的平台
  • 贵阳网站制作方舟网络引擎搜索对人类记忆的影响
  • 锡盟做网站怎样注册个人网站
  • wordpress 小工具参数seo黑帽教程视频
  • 手机能制作软件吗广东seo
  • 用公司网站后缀做邮箱网页推广怎么做
  • 行业网站作用广告优化师工作内容
  • 中国男女直接做的视频网站2022年新闻热点摘抄
  • 网站首页图片素材长图优化网站页面
  • 小程序上线需要多少钱深圳百度seo公司
  • 泰安做网站的百度搜索一下
  • 网站制作东莞青岛网站制作
  • qq空间怎么添加wordpress谷歌seo优化怎么做
  • 上海网站外包建设seo岗位工资
  • 网站制作论文优帮云南宁网站运营优化平台
  • 万网有网站建设吗制作网站用什么软件
  • 邢台做网站多少钱平台推广渠道
  • 怎么用h5网站做动效福建百度推广
  • 秦皇岛哪家公司网站建设好免费源码资源源码站
  • 查询企业信息的官方网站百度seo快速排名优化服务
  • 日文网站制作快手刷粉网站推广
  • 可不可以用p2p做视频网站想建立自己的网站怎么建立