摘要: SpringBoot加载运行时监听器(SpringApplicationRunListeners) 利用 Spring 工厂加载机制,读取 SpringApplicationRunListener 对象集合,并且封装到组合类 SpringApplicationRunListeners 实现运行时监听 阅读全文
posted @ 2020-06-03 10:27 樊梨花大大王 阅读(829) 评论(0) 推荐(0) 编辑
摘要: SpringBoot加载应用事件监听器 利用 Spring 工厂加载机制,实例化 ApplicationListener 实现类,并排序对象集合 创建应用事件监听器 创建类实现接口ApplicationListener,可以使用@Order或实现Orderd接口进行排序 @Order(Ordered 阅读全文
posted @ 2020-06-03 10:26 樊梨花大大王 阅读(322) 评论(0) 推荐(0) 编辑
摘要: SpringBoot加载应用上下文初始器 利用 Spring 工厂加载机制,实例化 ApplicationContextInitializer 实现类,并排序对象集合。 关键方法 private <T> Collection<T> getSpringFactoriesInstances(Class< 阅读全文
posted @ 2020-06-03 10:25 樊梨花大大王 阅读(452) 评论(0) 推荐(0) 编辑