This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
We can get this EJB injected into any Managed Component like Servlets and other EJB's using DI
This is my understanding of Dependency Injection.
I was reading MZ Notes section "Annotations for Environment Entries" i got confused with the concept mentioned there which says:
By Default, the name of the field is combined with name of the class in which the annotation is used and is used directly as the name in the bean's naming context.
According to this
@EJB MyEJBBusinessInterface abcDI; will search for java:comp/env/com.foo.abc.MyABC/abcDI
@EJB MyEJBBusinessInterface xyzDI; will search for java:comp/env/com.foo.xyz.MyXYZ/xyzDI
so to me these are two different references in the bean's naming context. I want to understand how MyEJB (the bean to be injected) is available to both?
And when we declare this bean
This bean is supposed to be available/placed in the JNDI(Global) or Bean's Naming Context(java:comp/env) (I would be very thankful if some one can explain where exactly) by the container for sure because then only DI can work.
I want to know is this Automatic? I mean just use @Stateless annotation and its done ?? is it??
Thanks in Advance.
[ October 14, 2008: Message edited by: Juggy Obhi ] [ October 14, 2008: Message edited by: Juggy Obhi ]
It does not matter how many times you fall,what matters is how many times you stand back.