springboot中@PostConstruct、CommandLineRunner、BeanPostProcessor执行顺序

如果一个类中分别实现了@PostConstruct、CommandLineRunner、BeanPostProcessor涉及的方法,它们执行的先后顺序:

Constructor(类构造方法) > @Autowired(类中注入的对象) > @PostConstruct > BeanPostProcessor > CommandLineRunner
posted @ 2020-04-10 10:57  赛博朋克水管工  阅读(1810)  评论(0编辑  收藏  举报