Skip to content

@Configuration imported via ImportBeanDefinitionRegistrar is not processed as configuration [SPR-11430] #16056

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
spring-projects-issues opened this issue Feb 15, 2014 · 5 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Feb 15, 2014

Dave Syer opened SPR-11430 and commented

@Configuration imported via ImportBeanDefinitionRegistrar is not processed as configuration. Actually it seems to get proxied OK, but the @Beans inside it are not instantiated or registered with the bean factory.


Affects: 4.0.1

Issue Links:

Referenced from: commits 71c6eb2

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

Since ImportBeanDefinitionRegistrars kick in during the configuration class processing phase, I'm not surprised that they can't register configuration classes themselves properly.

If this is important to you, Dave, we can try to make it work. Do you have any specific use cases for it, in particules ones that can't be expressed any other way?

Juergen

@spring-projects-issues
Copy link
Collaborator Author

Dave Syer commented

I do think it's important. I want to write an @Enable* annotation that pulls in a load of beans that are already encapsulated in a @Configuration (or an XML file I guess). It seems that the only way I can do it is to duplicate all the bean definitions and register them manually. It would be very fragile (not to mention unreadable). I'm surprised no-one asked for this before, actually, since it seems like an obvious thing to do.

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

I'm afraid we can only properly address this in the 4.1 timeframe, since the required changes are rather involved in terms of lifecycle implications. 4.1 is just half a year away though, with an RC1 due in 3 months and a bit...

Juergen

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Aug 12, 2014

Juergen Hoeller commented

Finally addressed through reiterating the configuration class detection algorithm until no new configuration bean definitions are being found in the registry, similar to how we do it for BeanDefinitionRegistryPostProcessors (#15258).

Juergen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants