Questions about ejb session bean behavior when used as injected bean instances. I'm not 100% sure how this works. I guess it from practice and from reading documents on the subject. I want to know how @EJB annotation is processed by container in detail.
Session bean have interfaces, impl class, deployment descriptor. We package them in ejb jar.
- What is putted in global JNDI by container? Static references to business interfaces ?
- How and when global JNDI is read from ?
- When component JNDI ENC is populated with ejb reference ?
- Is this reference in JNDI ENC (java:comp/env/beanB) is reference to session bean component interface, session bean instance proxy or session bean instance ? Is there difference for SLSB and SFSB ?
- With @EJB annotation on field does every new ejb session bean instance get new instance of injected ejb in the annotated field or all ejb instances share the same injected ejb session bean instance ?
- Does ejb injection by lookup (on session context) provide always new injected ejb instance, example: calling ctx.lookup(ejbReference) in loop ?