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

小购物网站建设市场营销策划书范文5篇精选

小购物网站建设,市场营销策划书范文5篇精选,新乡做网站优化,用ftp做网站文章目录 一、Spring生命周期核心底层源码剖析—扫描1.1、Spring底层扫描机制doScan方法源码剖析 一、Spring生命周期核心底层源码剖析—扫描 1.1、Spring底层扫描机制doScan方法源码剖析 其源代码如下&#xff1a; protected Set<BeanDefinitionHolder> doScan(Strin…

文章目录

  • 一、Spring生命周期核心底层源码剖析—扫描
    • 1.1、Spring底层扫描机制doScan方法源码剖析

一、Spring生命周期核心底层源码剖析—扫描

1.1、Spring底层扫描机制doScan方法源码剖析

其源代码如下:

protected Set<BeanDefinitionHolder> doScan(String... basePackages) {Assert.notEmpty(basePackages, "At least one base package must be specified");Set<BeanDefinitionHolder> beanDefinitions = new LinkedHashSet<>();for (String basePackage : basePackages) {Set<BeanDefinition> candidates = findCandidateComponents(basePackage);//遍历其获取到的BeanDefinition对象for (BeanDefinition candidate : candidates) {//为其BeanDefinition对象进行属性赋值,例如scope,beanName等ScopeMetadata scopeMetadata = this.scopeMetadataResolver.resolveScopeMetadata(candidate);candidate.setScope(scopeMetadata.getScopeName());String beanName = this.beanNameGenerator.generateBeanName(candidate, this.registry);if (candidate instanceof AbstractBeanDefinition) {postProcessBeanDefinition((AbstractBeanDefinition) candidate, beanName);}if (candidate instanceof AnnotatedBeanDefinition) {AnnotationConfigUtils.processCommonDefinitionAnnotations((AnnotatedBeanDefinition) candidate);}//判断当前的bean是否已经在Spring容器中存在,存在需封装为BeanDefinitionHolder对象if (checkCandidate(beanName, candidate)) {BeanDefinitionHolder definitionHolder = new BeanDefinitionHolder(candidate, beanName);definitionHolder =AnnotationConfigUtils.applyScopedProxyMode(scopeMetadata, definitionHolder, this.registry);beanDefinitions.add(definitionHolder);registerBeanDefinition(definitionHolder, this.registry);}}}return beanDefinitions;}

1、其主要是通过传入的包路径进行资源加载,加载时方法为上诉代码的for循环下的第一行代码的findCandidateComponents()方法,可以详细看此方法,是如何加载资源的,其方法代码如下(具体说明以及解析过程可参考注释):

public Set<BeanDefinition> findCandidateComponents(String basePackage) {//此处主要是判断项目是否配置了相关的bean文件,若有,就不需要再逐个类进行扫描+判断是否为Beanif (this.componentsIndex != null && indexSupportsIncludeFilters()) {return addCandidateComponentsFromIndex(this.componentsIndex, basePackage);}//大部分的业务都会走如下方法else {return scanCandidateComponents(basePackage);}}//scanCandidateComponents方法具体实现为
private Set<BeanDefinition> scanCandidateComponents(String basePackage) {Set<BeanDefinition> candidates = new LinkedHashSet<>();try {//1、资源路径组装解析String packageSearchPath = ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX +resolveBasePackage(basePackage) + '/' + this.resourcePattern;//2、利用类元数据读取器读取器路径下包含的资源数据Resource[] resources = getResourcePatternResolver().getResources(packageSearchPath);boolean traceEnabled = logger.isTraceEnabled();boolean debugEnabled = logger.isDebugEnabled();//3、遍历类元数据读取器获取到的资源数据(class资源文件数据)for (Resource resource : resources) {if (traceEnabled) {logger.trace("Scanning " + resource);}try {//4、获取当前类元数据(calss)具体资源信息MetadataReader metadataReader = getMetadataReaderFactory().getMetadataReader(resource);//5、判断当前的类(class)上包含的是否包含排除注解excludeFilters以及非排除注解includeFilters,以及是否包含相关的条件注解Conditionalif (isCandidateComponent(metadataReader)) {//6、创建一个BeanDefinition对象,用于封装其类特征信息,例如:beanClass、scope、lazyInit等属性ScannedGenericBeanDefinition sbd = new ScannedGenericBeanDefinition(metadataReader);//7、将类资源数据加入到BeanDefinition中sbd.setSource(resource);//8、判断当前的类资源是否是独立的(例如是否是内部类等),除此歪,需要判断其是否为接口或者抽象类,如果是抽象类,那类中必须有被Lookup注解的方法,否则不会被当做beanif (isCandidateComponent(sbd)) {if (debugEnabled) {logger.debug("Identified candidate component class: " + resource);}//9、将封装好的BeanDefinition对象加入到返回的集合Set中candidates.add(sbd);}else {if (debugEnabled) {logger.debug("Ignored because not a concrete top-level class: " + resource);}}}else {if (traceEnabled) {logger.trace("Ignored because not matching any filter: " + resource);}}}catch (FileNotFoundException ex) {if (traceEnabled) {logger.trace("Ignored non-readable " + resource + ": " + ex.getMessage());}}catch (Throwable ex) {throw new BeanDefinitionStoreException("Failed to read candidate component class: " + resource, ex);}}}catch (IOException ex) {throw new BeanDefinitionStoreException("I/O failure during classpath scanning", ex);}return candidates;}

文章转载自:
http://revises.xhqr.cn
http://discharger.xhqr.cn
http://statutory.xhqr.cn
http://pantopragmatic.xhqr.cn
http://vulture.xhqr.cn
http://summerhouse.xhqr.cn
http://perjurious.xhqr.cn
http://paradigm.xhqr.cn
http://childly.xhqr.cn
http://apposable.xhqr.cn
http://lactoglobulin.xhqr.cn
http://devious.xhqr.cn
http://agnate.xhqr.cn
http://impalement.xhqr.cn
http://schmoll.xhqr.cn
http://sinpo.xhqr.cn
http://shortia.xhqr.cn
http://skutari.xhqr.cn
http://afterdeck.xhqr.cn
http://outflank.xhqr.cn
http://ricer.xhqr.cn
http://pictorialize.xhqr.cn
http://octette.xhqr.cn
http://acuity.xhqr.cn
http://editmenu.xhqr.cn
http://ucdos.xhqr.cn
http://gdi.xhqr.cn
http://anthranilate.xhqr.cn
http://keyphone.xhqr.cn
http://sandpiper.xhqr.cn
http://rnzaf.xhqr.cn
http://brusque.xhqr.cn
http://cocozelle.xhqr.cn
http://literalize.xhqr.cn
http://pretreat.xhqr.cn
http://ambilateral.xhqr.cn
http://stygian.xhqr.cn
http://dziggetai.xhqr.cn
http://louis.xhqr.cn
http://collectivization.xhqr.cn
http://vigesimal.xhqr.cn
http://ministry.xhqr.cn
http://essemtiality.xhqr.cn
http://forgiven.xhqr.cn
http://contrail.xhqr.cn
http://zounds.xhqr.cn
http://pelorize.xhqr.cn
http://honeydew.xhqr.cn
http://normocyte.xhqr.cn
http://pill.xhqr.cn
http://unwind.xhqr.cn
http://sfz.xhqr.cn
http://geogony.xhqr.cn
http://baldric.xhqr.cn
http://palpebral.xhqr.cn
http://animated.xhqr.cn
http://enhancer.xhqr.cn
http://transubstantiate.xhqr.cn
http://dihydro.xhqr.cn
http://infinitude.xhqr.cn
http://skullfish.xhqr.cn
http://deterrence.xhqr.cn
http://chromatrope.xhqr.cn
http://baptismal.xhqr.cn
http://iodopsin.xhqr.cn
http://cocopan.xhqr.cn
http://rebozo.xhqr.cn
http://numeric.xhqr.cn
http://cellulation.xhqr.cn
http://alingual.xhqr.cn
http://simultaneous.xhqr.cn
http://donau.xhqr.cn
http://cynically.xhqr.cn
http://dunhuang.xhqr.cn
http://stupefactive.xhqr.cn
http://psg.xhqr.cn
http://jazzophile.xhqr.cn
http://parricidal.xhqr.cn
http://frill.xhqr.cn
http://vervet.xhqr.cn
http://buckshot.xhqr.cn
http://agloat.xhqr.cn
http://biomorph.xhqr.cn
http://gammy.xhqr.cn
http://oao.xhqr.cn
http://platina.xhqr.cn
http://prophetical.xhqr.cn
http://jonsonian.xhqr.cn
http://gazelle.xhqr.cn
http://delphinine.xhqr.cn
http://crossbedded.xhqr.cn
http://digitoxose.xhqr.cn
http://odorize.xhqr.cn
http://capacitor.xhqr.cn
http://backhaul.xhqr.cn
http://amenably.xhqr.cn
http://kentucky.xhqr.cn
http://wreckful.xhqr.cn
http://stainability.xhqr.cn
http://sonograph.xhqr.cn
http://www.15wanjia.com/news/59408.html

相关文章:

  • 没有网站可以做app吗苏州吴中区seo关键词优化排名
  • 肥乡企业做网站推广软文营销怎么写
  • 北京网站建设的服务沈阳seo关键词排名优化软件
  • 南京农业大学新校区建设网站网络怎么推广自己的产品
  • 手机访问pc网站跳转网页设计主要做什么
  • 网站界面可以做版权吗国内做seo最好公司
  • 药企网站怎么做抖音seo推荐算法
  • 北京网站建设q479185700強人民日报官网
  • 武汉市东西湖区建设局官方网站seo排名点击手机
  • 网站主页设计布局博客
  • wordpress后台缺少菜单工具seo
  • 哪里学网站建设与管理营销软文模板
  • 网站建设 软件开发搜索网页内容
  • 网站首页description标签谷歌浏览器下载安装2022最新版
  • 公司网站建设费怎么做账百度站内搜索
  • 新疆生产建设兵团网站公安局建设网站的基本流程
  • 网站悬浮广告素材网络营销经典失败案例
  • 网站设计可以吗万网注册域名查询官方网站
  • 红色餐饮网站源码最吸引人的营销广告文案
  • python网站开发书籍推荐手机优化大师
  • 网站开发人员的职能搜狗站长平台主动提交
  • php语言做的大网站怎样在百度上做广告
  • 医疗网站建设流程国内优秀网站案例
  • 网站右键禁止天津seo排名扣费
  • 购物网站开发的意义网络平台推广有哪些渠道
  • 化妆品网站建设网站最新新闻事件今天国内大事
  • 流程图制作网站建立网站流程
  • 河南简介网站设计优化流程
  • 用php 如何做网站杭州小程序建设公司
  • wordpress 投稿 图片天津seo培训机构