|
From: Rajeev K. <Ra...@cu...> - 2003-11-19 20:43:33
|
Message Although, I would still prefer a simpler method that just =
returns a boolean, but your solution will work for me.
Thanks!!!!
----- Original Message -----=20
From: Dmitriy Kopylenko=20
To: spr...@li...=20
Sent: Wednesday, November 19, 2003 11:15 AM
Subject: RE: [Springframework-developer] how to determine if a bean =
exists in registry?
Or better yet use AbstractBeanFactory.getBeanDefinition(String =
beanName) which would throw NoSuchBeanDefinitionException if bean does =
not exist.
Regards,
Dmitriy.
-----Original Message-----
From: spr...@li... =
[mailto:spr...@li...] On Behalf =
Of Kopylenko, Dmitry
Sent: Wednesday, November 19, 2003 2:08 PM
To: 'spr...@li...'
Subject: RE: [Springframework-developer] how to determine if a bean =
exists in registry?
Rajeev,
you could use String[] getAliases(String name) throws =
NoSuchBeanDefinitionException in BeanFactory and catch =
NoSuchBeanDefinitionException. If caught, then bean does not exist in =
the factory.
Dmitriy.
-----Original Message-----
From: Rajeev Kaul [mailto:Ra...@cu...]=20
Sent: Wednesday, November 19, 2003 1:54 PM
To: spr...@li...
Subject: [Springframework-developer] how to determine if a bean =
exists in registry?
Is there an easy way to determine if a certain bean exists in the =
beanFactory? I know one can use the getBean(name) to determine that, =
but it seems an expensive call, especially, if there are bean post =
processors associated with it. Don't you think having a function like =
boolean containsBean(String beanName) in a beanFactory class would be =
useful here?
Rajeev Kaul
|