Spring / Spring Interview questions II
How do I remove a spring bean from ApplicationContext?
A spring bean can be removed from context by removing its bean definition.
BeanDefinitionRegistry factory = (BeanDefinitionRegistry) context.getAutowireCapableBeanFactory(); factory.removeBeanDefinition("mongoRepository");
More Related questions...