随笔分类 -  Spring

摘要:该类用来扫描 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)
摘要:这个接口就是对 DefaultListableBeanFactory 容器进行配置的;虽然是对 DefaultListableBeanFactory 进行配置,但是只有在使用 ApplicationContext 容器的时候,这个接口的实例才会被调用。有的文章中会有 BFPP,它是这个接口的简写。 阅读全文
posted @ 2022-06-15 22:02 不是很聪明 阅读(22) 评论(0) 推荐(0)
摘要:PropertyEditorRegistry 接口的名字虽然和 org.springframework.beans.PropertyEditorRegistrar 接口名字很像,但是功能完全不一样;因为这个接口才是真正注册 Class 和 PropertyEditors 映射关系的,而这些映射关系都 阅读全文
posted @ 2022-06-11 23:26 不是很聪明 阅读(46) 评论(0) 推荐(0)
摘要:这里说的是 org.springframework.beans.PropertyEditorRegistrar 而不是 org.springframework.beans.PropertyEditorRegistry 接口。 这个接口就是注册器,用来注册一组属性编辑器的,可以将一些属性编辑器进行分组 阅读全文
posted @ 2022-06-07 13:32 不是很聪明 阅读(115) 评论(0) 推荐(0)