Created
July 9, 2015 13:35
-
-
Save Kotlin-Native/e2f3eb1fa6f4de57142d to your computer and use it in GitHub Desktop.
SpringCdiExtension connectCdiAndSpring
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public void connectCdiAndSpring(@Observes AfterBeanDiscovery event, BeanManager manager) throws ClassNotFoundException { | |
| ConfigurableApplicationContext springContext = new ClassPathXmlApplicationContext("classpath:context.xml"); | |
| for (String beanName: applicationContext.getBeanDefinitionNames()) { | |
| BeanDefinition beanDefinition = applicationContext.getBeanFactory().getBeanDefinition(beanName); | |
| event.addBean(createBean(beanDefinition)); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment