spring-projects / spring-projects/spring-framework
Improve org.springframework.beans.factory.BeanRegistry.Spec in order to improve the control over bean creation when programatically registering beans
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 60.2k
- Forks
- 38.8k
- Avg merge
- 5d 2h
- Merged PRs (30d)
- 27
Description
Hi everyone !
Currently when registering beans programatically with a bean customizer , the customizer is a
java.util.function.Consumer<Spec>
The Spec in a interface ( org.springframework.beans.factory.BeanRegistry.Spec )
It permits to set
- the scope, as the @org.springframework.context.annotation.Primary annotation would
- the order, as the @org.springframework.context.annotation.Order annotation would
- the fallback flag
- the backgroundInit flag as the @... .Bean.bootstrap() annotation would
It misses some useful methods
- One for defining the bean qualifier as the @org.springframework.beans.factory.annotation.Qualifier would
- One for defining the initMethod cf. org.springframework.context.annotation.Bean.initMethod()
- One for defining the destroyMethod cf. org.springframework.context.annotation.Bean.destroyMethod()
- One for defining the autowireCandidate flag cf. org.springframework.context.annotation.Bean.autowireCandidate()
- One for defining aliases cf. @org.springframework.core.annotation.AliasFor
Yours,
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with org.springframework.beans.factory.BeanRegistry.Spec and trace how the Consumer<Spec> is used for programmatic bean registration. Compare the requested qualifier, initMethod, destroyMethod, autowireCandidate, and alias controls with the corresponding annotations and existing Spec options. Done means the requested controls are available and their registration behavior is covered by appropriate tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100