a bean`s life

[color=blue]a bean`s life[/color]
[img]http://dl.iteye.com/upload/attachment/601457/785cfaa8-d65a-38b9-87ae-a072e0318215.png[/img]
1 Spring instantiates the bean.

2 Spring injects values and bean references into the bean’s properties.

3 If the bean implements BeanNameAware, Spring passes the bean’s ID to the set-BeanName() method.

4 If the bean implements BeanFactoryAware, Spring calls the setBeanFactory() method, passing in the bean factory itself.

5 If the bean implements ApplicationContextAware, Spring will call the set-ApplicationContext() method, passing in a reference to the enclosing appli-cation context.
6 If any of the beans implement the BeanPostProcessor interface, Spring calls their postProcessBeforeInitialization() method.

7 If any beans implement the InitializingBean interface, Spring calls their after PropertiesSet() method. Similarly, if the bean was declared with an init-method, then the specified initialization method will be called.

8 If there are any beans that implement BeanPostProcessor, Spring will call their postProcessAfterInitialization() method.

9 At this point, the bean is ready to be used by the application and will remain in the application context until the application context is destroyed.

10 If any beans implement the DisposableBean interface, then Spring will call their destroy() methods. Likewise, if any bean was declared with a destroy-method, then the specified method will be called.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值