How to execute jobs just after spring loads application context?

后端 未结 5 1504
萌比男神i
萌比男神i 2021-02-01 03:14

I want to run some jobs just after loading the Spring context but I do not know how to do this.
Do you have any idea how to do that?

5条回答
  •  佛祖请我去吃肉
    2021-02-01 03:59

    Use the @PostConstruct annotation. Than you can combine any job properties and guarantee to run your method on the load context.

提交回复
热议问题