title: Multiple Spring Components\ Beans of the same type
body: <p>I have a base class <code>Foo</code> and multiple classes that inherit from it.</p>
  
  <p>Until now I've needed exactly one of each</p>
  
  <p>So I just did:</p>
  
  <pre><code>@Autowired 
  private List&lt;Foo&gt; foos;
  </code></pre>
  
  <p>But things has changed and I'd like to generate multiple objects of every type (i.e. <code>x</code> instances for <code>Foo1</code>, <code>y</code> instances for <code>Foo2</code> etc)</p>
  
  <p>How can I do that using Spring Boot?</p>
  
  <p>Note: I don't really need it to be populated into the list.</p>
  
  <p><strong>EDIT:</strong> </p>
  
  <p>I'll explain further about the problem I'm facing. Each class represents a type of task (It's a <code>Runnable</code>). Each task has a fixed number of threads. I'd like to instantiate a new object for every thread.</p>
  
  <p>So my question is: How to utilise Spring for that cause? Back when I needed only one instance for every task it was easy (see the <code>List&lt;Foo&gt;</code> example)</p>