-
Type:
New Feature
-
Status: Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: 5.x Backlog
-
Component/s: Core:DI
-
Labels:None
-
Last commented by a User:true
There is a gap in the the functional bean registration features in BeanDefinitionBuilder and GenericApplicationContext. Once you register a Supplier you have committed to provide an instance of the class you register, whereas in a lot of use cases you don't know whether or not you want to provide it until the bean factory is available (e.g. conditional on another instance of the same class being available). I guess the change needs to be in the BeanDefinitionRegistry interface, for example to support a Predicate<ConditionContext> as well as the Supplier. If the interface doesn't change, I suppose returning null from the Supplier might be an option, but that seems a bit ugly, and might be too late, since the BeanDefinition has already been registered at that point.
- relates to
-
SPR-13779 Programmatic bean registration within configuration classes
-
- Open
-