摘要: 该类用来扫描 classpath(类路径)上的类,并注册为 BeanDefinition。默认会扫描 Spring 中的 @Component、@Repository、@Service 或 @Controlle 注释的类;还有 Java EE 6's javax.annotation.Managed 阅读全文
posted @ 2022-06-18 17:26 不是很聪明 阅读(240) 评论(0) 推荐(0)
摘要: Spring 提供类路径扫描,用于查找指定包下的带注解的组件。假设指定包下有 1000 个类,其中只有 500 个是 Bean,那么类路径扫描会多扫描 500 次;为了解决这个问题并提高应用启动速度,会将 500 个 Bean 保存到 META-INF/spring.components 文件中,当 阅读全文
posted @ 2022-06-18 15:48 不是很聪明 阅读(87) 评论(0) 推荐(0)