title: OSGI - Inject bean in new object
body: <p>I may not fully grasp the concept of beans and services but all my researches lead me to nothing.</p>
  
  <p>In my OSGI project, I got a bundle <code>A</code> that provide a service (called <code>myService</code>).</p>
  
  <p>A bundle <code>B</code> consume this service in a bean (called <code>myBean</code>) that is also exposed as a service.</p>
  
  <p>Beans and service declaration is done in Blueprint.</p>
  
  <p>For now, both bundle A and B are resolved by Karaf and the wiring is ok.</p>
  
  <p>But my bundle B has another bean (called <code>myOtherBean</code>), also exposed as service, that dynamically creates new objects. Those objects (called <code>MyObject</code>) must have a reference on the bean <code>myBean</code>.</p>
  
  <p>How could I pass the reference? </p>
  
  <p>An easy way would be to put the reference in my bean <code>myOtherBean</code> and inject it through the constructor of <code>MyObject</code>. But I am wondering if there could be another way to do that. Some suggested to use the <code>@Inject</code> annotation in <code>MyObject</code> but I can't make it work.</p>