title: Pass Parameter to Instance of @Inject Bean
body: <p>I am using CDI as injection framework, but I have found some limitations in its usage, and this is one of them. I am trying to initialize the creation of a bean instance with <strong>runtime</strong> values. Example:</p>
  
  <pre><code>@RequestScoped
  public class MyNumber {
     int number;
  
     public MyNumber(int number) {
        this.number = number;
     }
  
     public String toString() {
        return "Your number is: " + number;
     }
  }
  
  public class UseNumber {
     @Inject
     Instance&lt;MyNumber&gt; number;
  
     public void doStuff() {
        int a = 8;
        MyNumber mN = number.select(a).get(); // ?? - Obviously this does not work.
  
        System.out.print(mN); // Should print: "Your number is: 8"
     }
  }
  </code></pre>
  
  <p>Please, notice that "a" is a constant in the example, but in practice it is a variable; I clarify this so you don't post an answer with a <code>@Producer</code> to inject the value then in the constructor of <code>MyNumber</code>.</p>
  
  <p>Now, anybody has an idea about how can I do that?</p>