|
From: ShiLei <zuc...@gm...> - 2007-07-25 03:37:06
|
Bill
hi,
well, Based on my comprehension of Spring Bean initialization mechanism,
your patches are going to work.
All beans including these InitializingBeans or these custom beans which are
register in ApplicationContext XML files are identically initialized by
Beanfactory. It means constructors of beans can be defined *arbitrarily.*
And the difference between InitializingBeans and others is when BeanFactory
creating Beans, it test whether the bean is a instance of InitializingBean
or not to decide to invoke its *afterPropertiesSet()* method or not like
below.
-----------------------------------------------------------
if (bean instanceof InitializingBean) {
((InitializingBean) bean).afterPropertiesSet();
}
------------------------------------------------------------
I hope it help
Regards,
Shi
|