ApplicationContext applicationContext= new ClassPathXmlApplicationContext("spring.xml");
文件系统路径获取配置文件
ApplicationContext applicationContext = new FileSystemXmlApplicationContext("/home/usr/learn-spring-framework5.2/spring-demo/src/main/resources/spring.xml");
Java 配置类
ApplicationContext applicationContext = new AnnotationConfigApplicationContext(SpringDemoConfig.class);
Spring 核心加载方法
AbstractApplicationContext#refresh()方法是 Spring 容器启动过程中的核心方法
finally { // Reset common introspection caches in Spring's core, since we // might not ever need metadata for singleton beans anymore... // 重置 Spring 内核中的公用缓存 resetCommonCaches(); } } }