How to control order of bean init-method invocation in Spring?

后端 未结 3 1269
夕颜
夕颜 2021-01-12 01:40

Suppose I have bean, which init-method or constructor should be called after init-method of another bean. Is it possible?

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-12 02:29

    Use @DependsOn annotation or depends-on attribute if you're using xml configuration.

提交回复
热议问题