aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Need for ejb-link Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Need for ejb-link" Watch "Need for ejb-link" New topic
Author

Need for ejb-link

seema mani
Ranch Hand

Joined: Sep 30, 2001
Posts: 49
hi
If I need to refer an enterprise bean from another, I can use the ejb-ref element. Within this element I specify the home and remote interfaces of the target bean. Now I can do a JNDI lookup of the target bean uing the ejb-ref-name.
Now my doubt is what is the benefit of the optional ejb-link element ? What additional purpose does it serve ?
Thanks
Seema


Sun Certified Java Programmer<br />Sun Certified Web Component Developer<br />Sun Certified Business Component Developer
Kathy Sierra
Cowgirl and Author
Ranch Hand

Joined: Oct 10, 2002
Posts: 1572
Howdy, or application assembly, ejb-link can be used when you are referring to another bean within the same .ear file. But it's optional... so why use it?
A couple of reasons;
* It allows the container to (potentially) do some optimizations.
* More importantly, it allows you to have two or more beans with the same <ejb-name> in the same .ear file, and distinguish between them (see page 420 in the spec, for an example).
cheers,
Kathy
Java technology is everywhere...If you develop software and haven't learned
Java, it's definitely time to dive in -- Head First.
-Scott McNealy, Sun Microsystems Chairman, President and CEO
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need for ejb-link