|
From: Dmitriy K. <dko...@ru...> - 2003-11-19 19:15:32
|
Or better yet use AbstractBeanFactory.getBeanDefinition(String beanName) which would throw NoSuchBeanDefinitionException if bean does not exist. =20 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, =20 you could use String[] getAliases(String name) throws NoSuchBeanDefinitionException in BeanFactory and catch NoSuchBeanDefinitionException. If caught, then bean does not exist in = the factory. =20 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? =20 Rajeev Kaul |