I have implemented a custom BeanDefinitionParser by extending AbstractBeanDefinitionParser.
The BeanDefinitionParser attempts to retrieve a BeanDefinition that is defined in a parent application context.
The custom BeanDefinitionParser is triggered in the following way:
This is how I attempt to retrieve the BeanDefinition in the parent application context from the custom BeanDefinitionParser:Code:ClassPathXmlApplicationContext classPathXmlApplicationContext = new ClassPathXmlApplicationContext(configLocations, parentApplicationContext);
However, the registry inside the BeanDefinitionParser does not contain any of the bean definitions from the parent application context. Is there another way to accomplish this? Is there no way to reference a parent context when using a custom BeanDefinitionParser?Code:BeanDefinitionRegistry registry = parserContext.getRegistry(); BeanDefinition parentBeanDefinition = registry.getBeanDefinition(parentBeanReference);
Thanks,
Andreas


Reply With Quote