Reputation: 946
EJB A has to access few other EJBs, all implementing a same business interface.
Is JNDI lookup the only way to dynamically lookup those EJBs, or is there some simpler way?
Upvotes: 0
Views: 54
Reputation: 1314
I am afraid, if you need to determine the EJB at runtime, there is no better way than a JNDI lookup.
Upvotes: 1
Reputation: 2981
A client needs the stub object to call the methods offered for an EJB. The JNDI service helps to store and to recover the EJB's stub deployed in the appserver.
If you dont use JNDI, the alternative is to create by yourself the stub object but I don't think this is easyer or simpler than the JNDI approach.
Upvotes: 0
Reputation: 945
Maybe I' not understanding the question but you could use @Inject or @EJB instead of doing a lookup since JEE5/6
Upvotes: 0