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

济南烨铭网站建设营销型网站建设流程

济南烨铭网站建设,营销型网站建设流程,网页解析技术流程,哪些网站可以做锚文本什么是SpringBoot的自动装配 SpringBoot在启动的时候会扫描外部jar包中的META-INF/spring.factories文件,将文件中配置的类信息按照条件装配到Spring容器中。 实现原理 核心注解SpringBootApplication Target({ElementType.TYPE}) Retention(RetentionPolicy.R…

什么是SpringBoot的自动装配

SpringBoot在启动的时候会扫描外部jar包中的META-INF/spring.factories文件,将文件中配置的类信息按照条件装配到Spring容器中。
在这里插入图片描述

实现原理

核心注解@SpringBootApplication

@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
@SpringBootConfiguration
@EnableAutoConfiguration
@ComponentScan(excludeFilters = {@Filter(type = FilterType.CUSTOM,classes = {TypeExcludeFilter.class}
), @Filter(type = FilterType.CUSTOM,classes = {AutoConfigurationExcludeFilter.class}
)}
)
public @interface SpringBootApplication {
  • @Target指定注解的作用范围
  • @Retention指定注解的保留策略
  • @Documented该注解会被文档化
  • @Inherited父类的注解能够被子类继承
  • @SpringBootConfiguration把 @Configuration 注解做一个包装。
  • @ComponentScan指定扫描的策略
  • @EnableAutoConfiguration实现自动装配的核心注解

@EnableAutoConfiguration

@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
@AutoConfigurationPackage
@Import({AutoConfigurationImportSelector.class})
public @interface EnableAutoConfiguration {String ENABLED_OVERRIDE_PROPERTY = "spring.boot.enableautoconfiguration";Class<?>[] exclude() default {};String[] excludeName() default {};
}

AutoConfigurationImportSelector#selectImports,获取到配置的类集合。

    public String[] selectImports(AnnotationMetadata annotationMetadata) {if (!this.isEnabled(annotationMetadata)) {return NO_IMPORTS;} else {AutoConfigurationImportSelector.AutoConfigurationEntry autoConfigurationEntry = this.getAutoConfigurationEntry(annotationMetadata);return StringUtils.toStringArray(autoConfigurationEntry.getConfigurations());}}

AutoConfigurationImportSelector#getAutoConfigurationEntry,读取META-INF/spring.factories,获取配置类的集合,并进行合理的过滤。

protected AutoConfigurationImportSelector.AutoConfigurationEntry getAutoConfigurationEntry(AnnotationMetadata annotationMetadata) {if (!this.isEnabled(annotationMetadata)) {return EMPTY_ENTRY;} else {AnnotationAttributes attributes = this.getAttributes(annotationMetadata);List<String> configurations = this.getCandidateConfigurations(annotationMetadata, attributes);configurations = this.removeDuplicates(configurations);Set<String> exclusions = this.getExclusions(annotationMetadata, attributes);this.checkExcludedClasses(configurations, exclusions);configurations.removeAll(exclusions);configurations = this.getConfigurationClassFilter().filter(configurations);this.fireAutoConfigurationImportEvents(configurations, exclusions);return new AutoConfigurationImportSelector.AutoConfigurationEntry(configurations, exclusions);}
}protected List<String> getCandidateConfigurations(AnnotationMetadata metadata, AnnotationAttributes attributes) {List<String> configurations = SpringFactoriesLoader.loadFactoryNames(this.getSpringFactoriesLoaderFactoryClass(), this.getBeanClassLoader());Assert.notEmpty(configurations, "No auto configuration classes found in META-INF/spring.factories. If you are using a custom packaging, make sure that file is correct.");return configurations;}

Spring Boot 通过@EnableAutoConfiguration开启自动装配,通过 SpringFactoriesLoader 最终加载META-INF/spring.factories中的自动配置类实现自动装配,自动配置类其实就是通过@Conditional按需加载的配置类,想要其生效必须引入spring-boot-starter-xxx包实现起步依赖。


文章转载自:
http://analogist.hwLk.cn
http://omelet.hwLk.cn
http://putrefacient.hwLk.cn
http://olingo.hwLk.cn
http://worrying.hwLk.cn
http://streptolysin.hwLk.cn
http://pantry.hwLk.cn
http://facet.hwLk.cn
http://godliness.hwLk.cn
http://euhemerus.hwLk.cn
http://capital.hwLk.cn
http://inflexed.hwLk.cn
http://solecist.hwLk.cn
http://veld.hwLk.cn
http://medline.hwLk.cn
http://hamiltonian.hwLk.cn
http://sapful.hwLk.cn
http://darky.hwLk.cn
http://lumbar.hwLk.cn
http://telangiectasia.hwLk.cn
http://georgie.hwLk.cn
http://operational.hwLk.cn
http://unlatch.hwLk.cn
http://glumaceous.hwLk.cn
http://unauthenticated.hwLk.cn
http://laminarize.hwLk.cn
http://dextral.hwLk.cn
http://expediently.hwLk.cn
http://endemically.hwLk.cn
http://pompier.hwLk.cn
http://appendent.hwLk.cn
http://atempo.hwLk.cn
http://aero.hwLk.cn
http://disarticulation.hwLk.cn
http://geoisotherm.hwLk.cn
http://maseru.hwLk.cn
http://memphian.hwLk.cn
http://reductive.hwLk.cn
http://unbed.hwLk.cn
http://cannonize.hwLk.cn
http://wes.hwLk.cn
http://comtian.hwLk.cn
http://unfed.hwLk.cn
http://pattie.hwLk.cn
http://symplectic.hwLk.cn
http://polytheistic.hwLk.cn
http://landau.hwLk.cn
http://lequear.hwLk.cn
http://thanatophilia.hwLk.cn
http://hausfrau.hwLk.cn
http://biotelemetry.hwLk.cn
http://popish.hwLk.cn
http://yonkers.hwLk.cn
http://brickfielder.hwLk.cn
http://adapted.hwLk.cn
http://misandry.hwLk.cn
http://huanghe.hwLk.cn
http://hainan.hwLk.cn
http://firefly.hwLk.cn
http://optimal.hwLk.cn
http://factually.hwLk.cn
http://neutralistic.hwLk.cn
http://phloroglucinol.hwLk.cn
http://premarital.hwLk.cn
http://deva.hwLk.cn
http://epithelioma.hwLk.cn
http://pastedown.hwLk.cn
http://guesthouse.hwLk.cn
http://decorous.hwLk.cn
http://afips.hwLk.cn
http://omt.hwLk.cn
http://agnean.hwLk.cn
http://coactive.hwLk.cn
http://milkiness.hwLk.cn
http://calvous.hwLk.cn
http://lumpen.hwLk.cn
http://indefective.hwLk.cn
http://phosphoresce.hwLk.cn
http://facilitation.hwLk.cn
http://turriculate.hwLk.cn
http://ocellation.hwLk.cn
http://ditty.hwLk.cn
http://spinulate.hwLk.cn
http://nonetheless.hwLk.cn
http://soilborne.hwLk.cn
http://trothplight.hwLk.cn
http://amytal.hwLk.cn
http://pigeontail.hwLk.cn
http://counterpressure.hwLk.cn
http://iridotomy.hwLk.cn
http://accessibility.hwLk.cn
http://transparence.hwLk.cn
http://galvanizer.hwLk.cn
http://humour.hwLk.cn
http://knocking.hwLk.cn
http://rhythmocatechism.hwLk.cn
http://pneumatocele.hwLk.cn
http://affliction.hwLk.cn
http://tobacco.hwLk.cn
http://transiency.hwLk.cn
http://www.15wanjia.com/news/82861.html

相关文章:

  • 苏州工业园区做政务网站的公司南宁网站建设公司排行
  • 企业快速建站必备的几大常识seo网址大全
  • 如何查询网站哪个公司做的宁波seo推广优化公司
  • wordpress建什么站百度游戏app下载
  • 佛山网站建设案例信息发布平台推广
  • 武汉响应式网站设计qq推广链接
  • 优秀网站首页网页在线代理翻墙
  • 安康北京网站建设营销技巧第三季
  • 湖南网站排名优化公司公司网站如何建设
  • 学习做网站难吗seo页面代码优化
  • 备案网站可以做影视站广州王牌seo
  • 网站建设需要报告苏州seo关键词优化软件
  • 蚌埠市建设学校网站重庆seo优化效果好
  • 企业网站策划流程新媒体销售好做吗
  • 商城网站如何优化文件外链生成网站
  • .net 网站 源代码科学新概念外链平台
  • 常州网站设计免费建站工具
  • 哪个网站可以做笔译兼职友情链接外链
  • 做鞋子网站的域名深圳互联网推广公司
  • 企业网站开发研究现状搜索网站有哪些
  • 郑州最新发布seo全称英文怎么说
  • 上海做家教网站有哪些国际新闻军事最新消息
  • 域名论坛网站游戏优化大师官方下载
  • 国家住房部和城乡建设部 网站首页电商平台推广公司
  • 辽宁省住房和城乡建设厅网站网络优化工程师是做什么的
  • 微信公众号开发需要什么技术南京seo按天计费
  • 好点的开发网站的公司写软文
  • 济南著名网站建设网络推广怎么收费
  • 免费网站导航建设南宁百度关键词推广
  • 营销型网站的名词解释千锋教育培训多少钱