verysu 设计模式 设计模式 响应式编程 百度开发平台 codeforces leetcode usfca

导航

springboot初始化

springboot实现缓存预热

SpringBoot实现初始化加载配置
Step1:采用实现springboot ApplicationRunner

该方法仅在SpringApplication.run(…)完成之前调用

Step2:采用实现InitializingBean

InitializaingBean接口为bean提供了初始化方法的方式,它只包括afterPropertiesSet()方法。

在spring初始化bean的时候,如果bean实现了InitializingBean接口

在对象的所有属性被初始化之后才会调用afterPropertiesSet()方法。

posted on 2024-01-11 01:24  泳之  阅读(7)  评论(0编辑  收藏  举报

我是谁? 回答错误