codecamp

Bean lifecycle

  1. Instantiate - 容器在 XML 文件里找到定义并实例化它们

  1. Populate properties - 使用 DI 填充属性

  1. Set Bean Name - If the bean implements BeanNameAware interface, spring passes the bean's id to setBeanName() method.

  1. Set Bean factory - If Bean implements BeanFactoryAware interface, spring passes the beanfactory to setBeanFactory() method.

  1. Pre Initialization - 也叫 postprocess. Spring 调用 postProcesserBeforeInitialization() 方法.

  1. Initialize beans - If the bean implements IntializingBean,its afterPropertySet() method is called. If the bean has init method declaration, the specified initialization method is called.

  1. Post Initialization - 调用 postProcessAfterInitialization() 方法

  1. Ready to use - 现在可以用它们了.

  1. Destroy - If the bean implements DisposableBean , it will call the destroy() method .
Singleton bean 是线程安全的吗?
Annotation-based container configuration?
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

Java 面试笔记

Java

多态 Polymorphism

Static 关键字

int 与 integer

Programme

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }