title: Equivalent to @EJB annotation for local variables?
body: <p>EJBs in Hibernate. Is there any equivalent to dependency injection</p>
  
  <pre><code>@EJB(mappedName = FoobarServiceInterface.JNDI_NAME_LOCAL)
  private FoobarServiceInterface foo;
  </code></pre>
  
  <p>when <code>foo</code> is a local variable?</p>
  
  <p>I managed to use either @EJB annotation for class members or</p>
  
  <pre><code>FoobarServiceInterface bar = (FoobarServiceInterface)InitialContext.doLookup(FoobarServiceInterface.JNDI_NAME_LOCAL);
  </code></pre>
  
  <p>to do a lookup, if <code>bar</code> is a local variable.</p>
  
  <p>However, I wonder if there is any annotation that can be used on local variables such as @EJB for class member variables.</p>