File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ejb-link??

 
Senthil Kumar
Ranch Hand
Posts: 264
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
we use ejb-ref, ejb-local-ref to refer other enterprise beans inside the bean class when we don't know the real JNDI name.And the Deployer maps these reference to the real JNDI name.

but what do we get when we use ejb-link here?.
 
Freddy Wong
Ranch Hand
Posts: 959
Eclipse IDE Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To understand more on ejb-link, let's take a look at this simple scenario.

Let's say you have 2 session beans: A and B.


Bean A needs to do a lookup for bean B. Since you don't know what JDNI name for bean B, you can use the <ejb-name> from <ejb-ref> to do the lookup. The <ejb-link> is used to tell that it's actually referring to SessionB.

Inside your bean A, you will have a code like this:
Object o = ctx.lookup("java:comp/env/ejb/SessionB);

The deployer can map the actual JNDI name for session B to a completely different name. If you use Sun Java System Application Server, it's defined in sun-ejb.xml.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic