开发者

Spring dependency injection: Inject all instances of interface

开发者 https://www.devze.com 2023-04-12 00:07 出处:网络
How, if possible can I configure a Spring bean with all a collection of other Spring beans that implements a specific interface?

How, if possible can I configure a Spring bean with all a collection of other Spring beans that implements a specific interface?

Example: I want to wire the CarFac开发者_如何学Pythontory bean with a list of beans implementing the CarManufacturer interface.


@Inject
private List<CarManufacturer> manufacturers;
0

精彩评论

暂无评论...
验证码 换一张
取 消