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

网站建设路由器怎么设置网络服务器无响应改进措施或应对策略

网站建设路由器怎么设置,网络服务器无响应改进措施或应对策略,asp如何做网站,页面设计考试题一、Import # 用法 1#xff09;Import(User.class)#xff1a;如果导入的是配置类#xff0c;将会按照配置类正常解析#xff0c;如果是个普通类就会解析成bean 2#xff09;Import#xff08;实现了ImportSelector接口的类.class#xff09;#xff1a;可以一次性注册…一、Import # 用法 1Import(User.class)如果导入的是配置类将会按照配置类正常解析如果是个普通类就会解析成bean 2Import实现了ImportSelector接口的类.class可以一次性注册多个bean返回一个String[]每一个值就是类的完整类路劲 3Import(MyImportBeanDefinitionRegistrar.class)可以一次性注册多个bean通过BeanDefinitionRegistry来动态注册BeanDefinition 4Import(MyDeferredImportSelector.class) 二、Configuration 2.1、概述 Configuration是用来代替传统的xml的配置方式配置bean的。 2.2、不加就不能配置bean吗 答能。  2.2.1、ComponentA /*** Author : 一叶浮萍归大海* Date: 2023/11/27 15:45* Description:*/ public class ComponentA {public ComponentA componentA() {System.out.println(ComponentAs NoArgsConstructor was invoked!);return new ComponentA();}} 2.2.2、MySpringConfig /*** Author : 一叶浮萍归大海* Date: 2023/11/27 15:45* Description:*/ Slf4j public class MySpringConfig {Beanpublic ComponentA componentA() {return new ComponentA();}} 2.2.3、SpringConfigurationMainApp /*** Author : 一叶浮萍归大海* Date: 2023/11/27 15:46* Description:*/ Slf4j public class SpringConfigurationMainApp {public static void main(String[] args) {AnnotationConfigApplicationContext context new AnnotationConfigApplicationContext(MySpringConfig.class);ComponentA componentA context.getBean(componentA, ComponentA.class);log.info(componentA:{},componentA);}} 2.3、加与不加的区别 配置类加了Configuration注解Spring会为配置类创建cglib动态代理Bean方法的调用就会通过容器getBean进行获取保证当Bean方法进行互调时Bean是单例的。 2.4、不加Configuration注解案例 2.4.1、ComponentA同2.2.1 2.4.2、ComponentB /*** Author : 一叶浮萍归大海* Date: 2023/11/27 15:45* Description:*/ public class ComponentB {public ComponentB componentB() {System.out.println(ComponentBs NoArgsConstructor was invoked!);return new ComponentB();}} 2.4.3、MySpringConfig /*** Author : 一叶浮萍归大海* Date: 2023/11/27 15:45* Description:*/ //Configuration Slf4j public class MySpringConfig {Beanpublic ComponentA componentA() {ComponentB componentB1 componentB();ComponentB componentB2 componentB();log.info(componentB1:{},componentB2:{},(componentB1 componentB2) ? {},componentB1,componentB2,(componentB1 componentB2));return new ComponentA();}Beanpublic ComponentB componentB() {return new ComponentB();}} 2.4.4、SpringConfigurationMainApp同上 2.5、加Configuration注解案例 代码同2.4但是要在MySpringConfig上标注Configuration注解。 2.6、结论 虽然配置类上加与不加Configuration注解都可以创建bean但是当Bean方法内部调用另一个Bean标注的方法时如果配置类没有加Configuration注解那么Spring将不会为其创建Cglib动态代理而是将被调用的Bean方法当做一个普通方法于是就出现了2.4中的结果。 2.7、原理 1、启动IOC容器的时候会注册一个解析配置的处理器 ConfigurationClassPostProcessor         2、调用invokeBeanFactoryPostProcessors(beanFactory)时就会去调用postProcessBeanDefinitionRegistry进行解析配置解析加了Configuration、Component、Import、Bean的类目的是为了注册BeanDefinition         3、ConfigurationClassPostProcessor.postProcessBeanFactory去创建cglib动态代理         4、当Bean方法进行互调时会通过cglib进行增强通过调用的方法名作为bean的名称去IOC容器中获取进而保证了Bean方法的单例 三、SpringBootApplication 3.1、概述 SpringBootApplication是SpringBoot中的注解通常标识在主启动类上表明当前应用是一个SpringBoot工程它实际上是一个复合注解结构如下 四、SpringBootConfiguration 4.1、概述 SpringBootConfiguration也是SpringBoot中的注解实际上就是一个Configuration表示启动类也是一个配置类结构如下 五、EnableAutoConfiguration 5.1、概述 EnableAutoConfiguration也是SpringBoot中的注解它导入了一个AutoConfigurationImportSelector用于加载classpath/META-INF/spring.factories中所定义的所有自动配置类并将这些自定配置类注册为bean结构如下 六、Conditional 6.1、概述 Conditional注解是Spring中的一个注解主要用于xxxAutoConfiguration类中用于程序员自定义starter时进行扩展这些自动配置类在IOC容器加载过程中最后才被加载其中起到关键作用的注解就是ConditionalXxx例如ConditionalOnMissingClass({org.aspectj.weaver.Advice})、ConditionalOnClass({Advice.class})、ConditionalOnProperty(...等等结构如下
http://www.yutouwan.com/news/419076/

相关文章:

  • 10m光纤做网站wordpress表格
  • 家具网站开发报告网站建设氺金手指排名11
  • 等保二级网站建设方案网站功能需求列表
  • 技术支持 合肥网站建设网站建设会使用的技术
  • 地板网站源码临沂市建设局的网站
  • 上海推广网站公司可以生成静态网站源码
  • 设计专业新手网站国家职业资格证书全国联网
  • 网站开发 培训织梦网站模板响应式
  • 网站有很多304状态码代写新闻稿
  • 长春高端品牌网站建设怎么查询在建工程
  • 怎样弄一个网站什么是关键词搜索
  • 惠州做网站的公司哪家好html5怎么做简单的网站
  • 武进区住房和城乡建设局网站免费平台
  • 注册域名网站wordpress制作小工具
  • 高端网站建设必去磐石网络平面设计网站大全有哪些
  • 外贸网站建设是什么意思做有声小说网站
  • 北京网站开发哪家专业网站推广计划包含的主要内容
  • 宣传册设计与制作模板免费seo1视频发布会
  • 怎么注册网站域名唐山网站制作价格
  • 网站运营做产品需要哪些知识discuz做电影网站
  • 如何在jsp上做网站页面公司怎么做网站平台
  • 新郑市网站建设电子商务网站建设实训报告
  • 网站 流量攻击设计公司网站模板
  • 做网站要钱吗深圳购物网站建设
  • 求推荐好的网站建设平台潜江做网站的
  • 厦门网站建设那家好搜索引擎优化工具深圳
  • html5网站抓取高州女网红遇害案犯罪嫌疑人被抓获
  • 长春网站建设致电吉网传媒优公众号如何推广宣传
  • 自行建造网站做图片能去哪些网站
  • wordpress oday惠州seo博客报价