I have a set of classes that extends an abstract class Executor. Let's say that these classes are ExecutorOne, ExecutorTwo and ExecutorThree. Then, I have a fourth class extending the Executor type, ExecutorFour, but also implementing the interface NotUsable.
I am using Spring 4.x to inject an instance of all the above beans into a list.
@Autowired
private final List<Executor> executors;
Is there any mechanism that allows me to not inject a bean of type ExecutorFour inside the list executors? I want the list executors to contain only three beans, respectively of type ExecutorOne, ExecutorTwo and ExecutorThree.
I tried to have a look at the @Conditional annotation, but it seems it is no use in this situation.
Thanks in advance.