-
Notifications
You must be signed in to change notification settings - Fork 38.6k
Closed
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancementA general enhancement
Milestone
Description
The implementations of ObjectProvider.stream()
look up all bean names for the type referenced and subsequently look up the bean instance itself. This means that a call to ….stream()
ultimately causes all bean instances to be initialized. It would be nice if there was a way to be selective about which of those instances I want to get by being able to filter on the bean name before instantiation.
My particular use case is to exclude beans of a particular type, so the filter being a BiPredicate<String, Class<?>>
would prevent my code from having to obtain a reference to a BeanFactory
to obtain the bean definition's type. That said, a simple stream(Predicate<String> beanNameFilter)
would work as well.
okohub
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancementA general enhancement