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

宁波网站建设地方做网站用php还是python

宁波网站建设地方,做网站用php还是python,如何进行网站营销,网站后台密码如何破解Spring启动流程 随着springboot的功能越来越强大,我们逐渐忘记了spring,但是每当遇到问题时缺无从下手, 我们在享受springboot给我们带来的便利的同时更应该了解其底层原理,知其然更要知其所以然,下面我们一起进入spr…

Spring启动流程

随着springboot的功能越来越强大,我们逐渐忘记了spring,但是每当遇到问题时缺无从下手,
我们在享受springboot给我们带来的便利的同时更应该了解其底层原理,知其然更要知其所以然,下面我们一起进入spring的世界探索吧

Spring启动

我们从springboot的入口(不使用springboot的方式放在后面文章讲解)来看spring是如何被启动的
我们都有启动类如下

AttachCode

@SpringBootApplication
public class Main {public static void main(String[] args) {SpringApplication.run(Main.class, args);}

我们先来看下SpringApplication.run(Main.class, args);我们今天的主要内容不是springboot,所以我们一路跟踪到spring的refesh方法

AttachCode

   public static ConfigurableApplicationContext run(Class<?>[] primarySources, String[] args) {return (new SpringApplication(primarySources)).run(args);}

AttachCode

public void refresh(){
//省略部分代码
this.refreshContext(context);
//省略部分代码
}

AttachCode

    private void refreshContext(ConfigurableApplicationContext context) {if (this.registerShutdownHook) {shutdownHook.registerApplicationContext(context);}this.refresh(context);}

今天的主角AttachCode

@Overridepublic void refresh() throws BeansException, IllegalStateException {synchronized (this.startupShutdownMonitor) {StartupStep contextRefresh = this.applicationStartup.start("spring.context.refresh");// Prepare this context for refreshing.prepareRefresh();// Tell the subclass to refresh the internal bean factory.ConfigurableListableBeanFactory beanFactory = obtainFreshBeanFactory();// Prepare the bean factory for use in this context.prepareBeanFactory(beanFactory);try {// Allows post-processing of the bean factory in context subclasses.postProcessBeanFactory(beanFactory);StartupStep beanPostProcess = this.applicationStartup.start("spring.context.beans.post-process");// Invoke factory processors registered as beans in the context.invokeBeanFactoryPostProcessors(beanFactory);// Register bean processors that intercept bean creation.registerBeanPostProcessors(beanFactory);beanPostProcess.end();// Initialize message source for this context.initMessageSource();// Initialize event multicaster for this context.initApplicationEventMulticaster();// Initialize other special beans in specific context subclasses.onRefresh();// Check for listener beans and register them.registerListeners();// Instantiate all remaining (non-lazy-init) singletons.finishBeanFactoryInitialization(beanFactory);// Last step: publish corresponding event.finishRefresh();}catch (BeansException ex) {if (logger.isWarnEnabled()) {logger.warn("Exception encountered during context initialization - " +"cancelling refresh attempt: " + ex);}// Destroy already created singletons to avoid dangling resources.destroyBeans();// Reset 'active' flag.cancelRefresh(ex);// Propagate exception to caller.throw ex;}finally {// Reset common introspection caches in Spring's core, since we// might not ever need metadata for singleton beans anymore...resetCommonCaches();contextRefresh.end();}}}

今天我们先到这里


本文由 idea的插件"AnNote"协助完成,是一款源码学习笔记,不但能够帮助我们做笔记、分享笔记还可以学习学霸的笔记。欢迎大家试用

http://www.dtcms.com/a/428842.html

相关文章:

  • 个人网站做推广制作网页填数据
  • 龙虎榜——20250930
  • 《时间回响:蓝环秘境》小说大纲
  • bigquery查询
  • php餐饮美食店网站源码 生成html太原百度关键词推广
  • 国内互联网建站公司排名中铁建设集团有限公司什么级别
  • 蚌埠企业网站建设套餐手机网址进不去怎么设置
  • Android Studio Logcat中 杀死应用
  • 一次由Flowable定时器引发的“401”悬案:深入解析异步线程中的Token传递
  • 龙华哪有做网站设计手加工外包加工网
  • C语言循环与函数详解
  • 昆明做网站那家好建设网站商城
  • seo的网站建设建站基础:wordpress安装教程图解 - 天缘博客
  • centos 7.2 做网站婚礼请柬电子版免费制作app
  • 宜兴网站建设公司qq推广网站
  • 网站建设 设备推广app软件
  • 【动态规划:子数组/子串系列】单词拆分 环绕字符串中唯⼀的子字符串
  • 做网站服务器要什么系统推广怎么推广
  • qq网站登录北京网站优化推广分析
  • CNN的可视化:特征图与卷积核可视化方法(代码实现)
  • 读写RPLMN等APDU log显示为FF FF FF……问题研究
  • CKAD-CN 考试知识点分享(8) 升级与回滚
  • 网站建设公司该如何选择服务称赞的项目管理平台
  • 哪里做网站比较快wordpress主题 视频
  • 网站建设实训总结范文品牌市场营销策略
  • 网站界面设计软件网站备案去哪注销
  • 网页设计感十足的网站移动开发软件
  • LangChain 中 “附加 OpenAI 函数” 和 “附加 OpenAI 工具”
  • 山东住房和城乡建设厅网站登陆平面设计必学软件
  • 凡客建站官网登录入口Wordpress仿制网站