Hello Mark,
I did a
test by using look-up method and objectFactoryBean to create bean2 in bean1(bean1 is singleton).
Both of them are working fine. So my question is that why don't use ObjectFactoryCreatingFactoryBean to create new bean in a singleton bean.
Can I use ObjectFactoryCreatingFactoryBean as a replacement for look-up method. The link you give me which mentioned ServiceLocatorFactoryBean, I guess it's the same thing with ObjectFactoryCreatingFactoryBean.
You are right,Message Driven pojo is a singlton bean. I'm using Message Driven pojo to handle the jms request, but one pojo is not enough in my project, I need to run some business process inside the jms listener(Pojo). And It takes some time to finish the business process.
So, I create multiple pojo in jms container.
Each Pojo need to create a new bean when the new jms data coming. But I can't decide which way should I use to create the new bean.(look-up method or objectFactoryBean) I guess maybe objectFactoryBean is better, because I don't need to use CGLIB.
Thank you for your reply.
[ November 04, 2008: Message edited by: mark ken ]