How do I get a reference of all beans implementing a specific generic interface (e.g. Filter
This is what I want to achieve wi
Just for reference, the simplest solution I could construct was this:
Map filters = context.getBeansOfType(Filter.class);
for(Filter filter: filters.values()){
try {
if (!filter.approve(event)) {
return; // abort if a filter does not approve the event.
}
} catch (ClassCastException ignored){ }
}
And it worked quite well for prototyping.