Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

question on ejb-link  RSS feed

 
Yan Zhou
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
I am having some confusion about ejb-link.
1) If an EJB refers to another EJB which is defined in the same/different ejb-jar file of the SAME J2EE app., the deployer must use ejb-link to refer to the target EJB.
2) What if an EJB wants to refer to another EJB in a different J2EE app. or even in a different container? It can do that by using JNDI to find the home interface for that remote EJB, right?
Now, the programming interface for both 1) and 2) see identical, both use JNDI and narrow to the home interface of another EJB, what is the difference and why is ejb-link necessary in 1) but not 2)?
Does ejb-link give the container some indication for performance gain since the container knows to look for the target EJB in the same J2EE application?
Thanks.
Yan
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the key thing is having the client stubs in the client EJB's classpath. If both EJBs reside within the same .ear, the client EJB can obtain the stub classes via the .ear classloader.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!