Suppose I have bean, which init-method or constructor should be called after init-method of another bean. Is it possible?
Use depends-on
attribute in spring context XML file:
<bean id="beanOne" class="ExampleBean" depends-on="manager">
<property name="manager"><ref local="manager"/></property>
</bean>
or @DependsOn
annotation on bean if you are using annotations.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With