Spring 3 中为 Bean 定义了 5 中作用域,分别为 singleton(单例)、prototype(原型)、 request、session 和 global session
bean 在springbean的生命周期:
1 实例化 2 设置属性 3 执行 setbeanName 方法
4 执行setApplicationContext 方法
5 执行postProcessBeforeInitialization 方法
6 执行afterPropertiesSet 方法
7 执行我们自己定义的 bean初始化方法
8 执行postProcessAfterInitialization 方法
9 使用我们的bean
10 执行destory
11调用定制的销毁方法
------------------------------------------------------------------------------------------------------------------------