I think I am confused with the way we access the
EJB in various circumstances. The following is my understaning so far. Please validate my understanding and correct me if I am wrong.
1. Invoking an EJB located in a remote server from stand along
Java client.
I cannot use @EJB annotation since there is no way for remote server's container
to inject dependency. So I need to use ACC to access an EJB located in a remote server.
I need to follow traditional JNDI look up to get a reference to the remote EJB.
2. Invoking an EJB located in a remote server from web application running on different server.
<same as above>
3. Invoking an EJB located in a remote server from a web application in a distrubuted environment.
In this case, since the environment is distrubuted, I can use DI (@EJB annotation) to
access EJB located in a remote server.
4. Invoking an EJB from any web application deployed in the same server and host.
I can use DI (@EJB) and it is straightforward approach.
am I correct?