aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes ejb-ref and ejb-local-ref 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 » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "ejb-ref and ejb-local-ref" Watch "ejb-ref and ejb-local-ref" New topic
Author

ejb-ref and ejb-local-ref

Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17257
    
    6

What is the difference between these two and Why do they have both?
what do they mean by Local?
Thanks
Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Manjunath Subramanian
Ranch Hand

Joined: Jul 18, 2001
Posts: 236
Hello Mark,
If you have worked on EJB , then you will know that there is a EJBHome and EJBObject interfaces,which are implemented by the EJB container.If the client (say a servlet or jsp) wants to communicate with the EJB then they do it with the help of stubs and skeletons.So the calls are basically remote calls.If the client and the enterprise beans are in the same machine running in the same process then there is no need of the client making remote calls to the EJB's if it implements a EJBLocal interface.This interface is implemented by the EJB container very much like the Home and Remote interfaces,so that the client can make local calls instead of remote calls.
The concept of stubs,skeletons,marshalling and unmarshalling doesn't come in the picture.
This increases the performance of the system
If the client is going to make a call on an object which implements the EJBLocal interface then use the ejb-local-ref in the DD.Else if the client is invoking a method call on a EJBObject stub then use the ejb-ref in the DD.
Hope this helps,
Manjunath
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17257
    
    6

Thanks.
But I had thought that they always placed the Home object on the JNDI tree, and that you still had to "Connect" to the application server. So by implementing the LocalHome interface the application server knows not to create the stubs and skeletons? hmm pretty interesting.
Mark
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ejb-ref and ejb-local-ref