随笔分类 -  springboot

接口动态代理IOC注入到spring容器中
摘要:public interface StudentService { public void add(String studentName); } 定义一个spring的FactoryBean,FactoryBean在通过spring实例化生成的不是自己本身,而是通过调用的getObject方法返回的 阅读全文

posted @ 2021-06-16 17:13 swave 阅读(557) 评论(0) 推荐(0)

Spring自定义实现ImportBeanDefinitionRegistrar引入外部类
摘要:import java.io.IOException; import org.springframework.beans.factory.support.BeanDefinitionRegistry; import org.springframework.context.annotation.Cla 阅读全文

posted @ 2021-06-16 15:16 swave 阅读(291) 评论(0) 推荐(0)

Spring的Import,ComponentScan,ImportResource原理
摘要:org.springframework.context.annotation.ConfigurationClassPostProcessor(Bean定义的后置处理器)中,轮询BeanDefinitionRegistry中注册的所有已注册的类,找出包含Import,ComponentScan,Imp 阅读全文

posted @ 2021-06-16 14:34 swave 阅读(246) 评论(0) 推荐(0)

springboot中如何启动tomcat
摘要:springboot启动时,会自动识别出当前环境是否是web环境还是非web环境。 ConfigurableApplicationContext org.springframework.boot.SpringApplication.createApplicationContext(): 那么我们来详 阅读全文

posted @ 2019-10-18 12:27 swave 阅读(1447) 评论(0) 推荐(0)

springboot的@EnableAutoConfiguration起作用的原理
摘要:通常我们启动一个springboot项目会在启动方法中增加@SpringBootApplicatoin注解,该注解中包含了@EnableAutoConfiguration 那么@EnableAutoConfiguration是如何自动起作用的呢。我们先来看看@EnableAutoConfigurat 阅读全文

posted @ 2019-06-03 11:54 swave 阅读(607) 评论(0) 推荐(0)

springboot加载bean过程探索
摘要:springboot一般通过以下main方法来启动项目 查看源码发现加载的主要逻辑写在了 ConfigurableApplicationContext org.springframework.boot.SpringApplication.run(String... args)这个方法里面 具体逻辑如 阅读全文

posted @ 2019-06-03 10:29 swave 阅读(8838) 评论(0) 推荐(1)

导航