Three kinds of callbacks after initialization of spring bean

1, a category of methods annotated @PostConstruct

2, to achieve InitializingBean interface implemented method afterPropertiesSet

3, xml embodiment, the method init-mothod property, the bean class points tag configuration.

 

 

 

 Their execution order is

1-@PostConstruct

2- InitializingBean implemented in afterPropertiesSet

3-xml way

 

 

 

 

Guess you like

Origin www.cnblogs.com/hkdpp/p/11872712.html