File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Which interface is used Remote or Local? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Which interface is used Remote or Local?" Watch "Which interface is used Remote or Local?" New topic

Which interface is used Remote or Local?

Sunil Patil

Joined: Feb 05, 2003
Posts: 15
If i define both Local and Remote interfaces for a EJB which one is used when i try to invoke it through
a) Java client
b) Another EJB in same server
What are rules for this

Anselm Paulinus
Ranch Hand

Joined: Sep 05, 2003
Posts: 390
Does the spec allow one to define both local and remote interfaces for a particular bean?
Remember the definition of the interfaces depends on what you feed to the entity tag on your ejb-jar.xml. Is it allowed to feed the tag with both remote and local interfaces?
Goan Balchao
Ranch Hand

Joined: Mar 25, 2002
Posts: 93
I think it is. You can use define the remote and local interfaces for an EJB (Except for a MDB).
Which interface you would use depends on your client. If your client is a remote client (distributed away from the container) e.g some web tier component deployed on a web server that is not co-located with the application server, you would use the remote interface and RMI /IIOP for invocation. But if your client is a local client e.g Session Facade accessing an EntityBean, you would use the local interface . Or the container may make some optimizations that end up with the local interface being used.
You can expose both the remote and the local client view, it depoends on the type of the client which view will be used.
Hope this helps.

Hemant Kamat<br />SCJP2<br />SCWCD<br />SCBCD<br />SCEA-I
I agree. Here's the link:
subject: Which interface is used Remote or Local?
It's not a secret anymore!