title: How to inject an instance of a class with a parameterized constructor using CDI (Java EE 6 only)
body: <p>I'm new to CDI, tried searching for the usage, could not find anything and so posting the question.  I'm trying to figure how I can inject an instance of a class with a parameterized constructor only using CDI.  I'm not using Spring so, how it is done in spring does not help.  Here is a sample I've created to show what's the issue.  My @Inject will not work in this scenario. </p>
  
  <pre><code>    public class A 
      {
          public A(boolean deliverFromLocalWarehouse)
          {
              if(deliverFromLocalWarehouse)
              {
                  wareHouseId = new Integer(10); 
              }
              else 
              {
                  wareHouseId = new Integer(100);
              }
          }
  
          public void deliver()
          {
              //get wareHouse address by Id and initiate delivery.   
          }
  
          private Integer wareHouseId = null;
      }
  
      public class B 
      {
  
          @Inject
          private A a;
      }
  </code></pre>
  
  <p>Thanks
  Srikrishna Kalavacharla</p>