Hi,
is there a way to use dependency injection to inject all available implementations of a specific interface in spring?
This is kind of the same thing as asked here for .NET.
Though my aim is to use @Autowired for this:
public class Foo{
@Autowired
private IDataCollector[] collectors;
}
Is this supported, would this require hacking or should I preferably use another component where all implementations of IDataCollector register themselve and use that accessor component with autowired instead of the array injection?
A reason I can think of why this may not be implemented per default may be, that it would also inject possible mock implementations where inappropriate. Though I'm still interested wether this is possible or not. :)