一、

1.

As you can see, a bean factory performs several setup steps before a bean is ready to
use. Let’s break down figure 1.5 in more detail:
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 calls the set-
ApplicationContext() method, passing in a reference to the enclosing appli-
cation context.
6 If the bean implements the BeanPostProcessor interface, Spring calls its post-
ProcessBeforeInitialization() method.
7 If the bean implements the InitializingBean interface, Spring calls its after-
PropertiesSet() method. Similarly, if the bean was declared with an init-
method , then the specified initialization method is called.
8 If the bean implements BeanPostProcessor , Spring calls its postProcess-
AfterInitialization() method.
9 At this point, the bean is ready to be used by the application and remains in the
application context until the application context is destroyed.
10 If the bean implements the DisposableBean interface, Spring calls its
destroy() method. Likewise, if the bean was declared with a destroy-method ,
the specified method is called.

SPRING IN ACTION 第4版笔记-第一章-005-Bean的生命周期的更多相关文章

  1. SPRING IN ACTION 第4版笔记-第一章-003-AOP介绍

    一.目标 要在BraveKnight调用embarkOnQuest()前后各做一些处理(调用Minstrel的方法) 二. 1.minstrel.xml <?xml version=" ...

  2. Spring In Action 第4版笔记-第一章-001架构

    1.Spring’s fundamental mission: Spring simplifies Java development. 2.To back up its attack on Java ...

  3. SPRING IN ACTION 第4版笔记-第一章-004-用类来管理DI

    一. 1. package chapter01.sia.knights.config; import org.springframework.context.annotation.Bean; impo ...

  4. SPRING IN ACTION 第4版笔记-第一章-002-DI介绍

    一. 1.knight.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns=&qu ...

  5. Android开发艺术探索笔记——第一章:Activity的生命周期和启动模式

    Android开发艺术探索笔记--第一章:Activity的生命周期和启动模式 怀着无比崇敬的心情翻开了这本书,路漫漫其修远兮,程序人生,为自己加油! 一.序 作为这本书的第一章,主席还是把Activ ...

  6. SPRING IN ACTION 第4版笔记-第九章Securing web applications-011-把敏感信息请求转为https(requiresChannel())

    1.把包含敏感信息的请求转为https请求,则较为安全,但如何只把有需要安全的请求转为https,而不是不加分辩就把所有请求都转为https呢?可以用requiresChannel() @Overri ...

  7. SPRING IN ACTION 第4版笔记-第九章Securing web applications-010-拦截请求

    一. What if you wanted to restrict access to certain roles only on Tuesday? Using the access() method ...

  8. SPRING IN ACTION 第4版笔记-第九章Securing web applications-008-使用非关系型数据库时如何验证用户(自定义UserService)

    一. 1.定义接口 Suppose that you need to authenticate against users in a non-relational database suchas Mo ...

  9. SPRING IN ACTION 第4版笔记-第九章Securing web applications-007-设置LDAP server比较密码(contextSource、root()、ldif()、)

    一.LDAP server在哪 By default, Spring Security’s LDAP authentication assumes that the LDAP server is li ...

随机推荐

  1. IDispose(), Finalize()

    C#  using 用法: 1. 作为指令,用于为命名空间创建别名或导入其他命名空间中定义的类型.(见例1-1) 2. 作为语句,用于定义一个范围,在此范围的末尾将释放对象.(见例1-2) (例子1- ...

  2. YII数据库操作(CURD操作)

    数据库操作 获得模型对象 $model = 模型名::model();或$model = new 模型名(); 1.查询多条记录(返回值:二维数组) $result = $model->find ...

  3. T-SQL基础 (子查询,连接查询,交叉查询,事务|| 笔记0807)

    一: A.子查询: 1.select 字段名 from table where 字段名=(select 字段名 from table 条件)  //只能做1个匹配 2.select 字段名 from ...

  4. ACM——A + B Problem (4)

    A + B Problem (4) 时间限制(普通/Java):1000MS/3000MS          运行内存限制:65536KByte总提交:2496            测试通过:124 ...

  5. Android SDK目录含义介绍

    Android SDK目录的具体结构: 1.add-ons:该目录下存放第三方公司为Android平台开发的附加功能系统. 2.build-tools:编译工具.保存着一些通用工具,比如aapt.ai ...

  6. pb popmenu弹出式选单位置的问题

    在主界面上使用m_main.m_title.PopMenu(PointX(),PointY()),可以正确定位弹出式选单的位置: 在主界面的控件智商为使用m_main.m_title.PopMenu( ...

  7. NSMutableParagraphStyle /NSParagraphStyle

    //   NSParagraphStyleAttributeName 段落的风格(设置首行,行间距,对齐方式什么的)看自己需要什么属性,写什么 NSMutableParagraphStyle *par ...

  8. UVA 11991 Easy Problem from Rujia Liu?(vector map)

    Easy Problem from Rujia Liu? Though Rujia Liu usually sets hard problems for contests (for example, ...

  9. C#语言之“string格式的日期时间字符串转为DateTime类型”的方法(转)

    原文链接:http://www.cnblogs.com/Pickuper/articles/2058880.html 方法一:Convert.ToDateTime(string) string格式有要 ...

  10. 九度OJ 1352 和为S的两个数字

    题目地址:http://ac.jobdu.com/problem.php?pid=1352 题目描述: 输入一个递增排序的数组和一个数字S,在数组中查找两个数,是的他们的和正好是S,如果有多对数字的和 ...