Allow functional bean registration to set bean order (equivalent to @Order) #30849
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: enhancement
A general enhancement
Milestone
Presently there is no equivalent to
@Order
when using functional bean registration to allow ordering of beans outside of the bean implementation (where@Order
, Ordered, PriorityOrdered etc can be used):@Order
works at sort time (provider.orderedStream()
or injecting a List<> of beans) by introspecting the factory method looking for@Order
via an implementation ofOrderComparator.OrderSourceProvider
that usesbeanDefinition.getResolvedFactoryMethod()
(org.springframework.beans.factory.support.DefaultListableBeanFactory.FactoryAwareOrderSourceProvider).It would be useful to have
order
as an optional first-class property onBeanDefinition
which would allow the functional bean registration API to (optionally) provide an order and furthermore allow@Order
processing to be collapsed to the same mechanism, while also providing future capabilities for any bean registration capability to support bean ordering.Without this capability there is no mechanism for functional bean registration to provide bean ordering external to the bean implementation, as is possible with
@Order
.The text was updated successfully, but these errors were encountered: