Skip to content
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

Improve documentation for JavaConfig's use of CGLIB for all @Configuration annotated classes [SPR-6885] #11551

Closed
spring-projects-issues opened this issue Feb 21, 2010 · 2 comments
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

Michael Isvy opened SPR-6885 and commented

All @Configuration classes are dynamically subclassed with CGLIB, and the MethodInterceptor that is applied in the overridden versions of all @Bean methods check the container first for any cached (scoped) beans, of course including singletons.

See ConfigurationClassEnhancer and BeanMethodInterceptor for details.

For this reason, @Configuration classes have certain restrictions, such as that they (and their @Bean methods) may not be final; they must have a no-arg constructor, etc.


Referenced from: commits 9e5b129, 6af9177

@spring-projects-issues
Copy link
Collaborator Author

Chris Beams commented

The changes to the documentation look good, Michael - thanks! You might consider adding one additional note that CGLIB is not a required dependency of Spring, so upon first use, users may get an error stating that CGLIB is required for processing @Configuration classes. This is of course resolved by adding CGLIB to the classpath via Maven, Ivy, etc.

@spring-projects-issues
Copy link
Collaborator Author

Chris Beams commented

also, the convention for section id naming in the @Configuration section is that the ids all start with 'beans-java-*'. Could you rename this to 'beans-java-implementation-notes', or something to that effect?

@spring-projects-issues spring-projects-issues added type: enhancement A general enhancement in: core Issues in core modules (aop, beans, core, context, expression) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 3.0.2 milestone Jan 11, 2019
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

1 participant