File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes EJB can local bean invoke business methods on remote interface passed from other JVM? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB can local bean invoke business methods on remote interface passed from other JVM?" Watch "EJB can local bean invoke business methods on remote interface passed from other JVM?" New topic
Author

EJB can local bean invoke business methods on remote interface passed from other JVM?

Vladas Razas
Ranch Hand

Joined: Dec 02, 2003
Posts: 385
Hi,
Here is excerpt from Kathy's and Bert's book which raises me a questions:
"Given a remote client 'R', that has valid references to session beans 'A' and 'B', and given that A is local to B, which statements are true?
Amongst others I chose:
A. R cannot pass his reference for A, to B.
Is it possible that bean B will call business methods on bean A using the remote interface it has received from R client? I understand it might just keep the remote ref to A for some purpose to return it later back at R, maybe. But can B invoke business methods? R and A-B are running on different JVMs, and the reference passed is a stub, which was supposed to let access the bean A from R computer, and the B is might be on the other computer. Can you carry remote interface stub between JVM's and still access business methods using it???
Nauman Khan
Ranch Hand

Joined: Aug 07, 2003
Posts: 49
I read this question and option
B,A cannot pass his reference for B, to R
D, B cannot invoke methods on R
are correct because reference to local object must not be passed out the JVM in which it was created(According to spec),so in that case A is the local client for B and A cannot pass his reference to R for B becauae R is a remote client and exist into other JVM. A client can pass his local object reference to another application through its local inteface, A local home object reference cannot be passed as an argument or result of a method on an enterprise bean remote home or remote interface.
Regards,


Nauman Khan <br />SCJP,MCSE,SCWCD,SCBCD,SCWCD1.4
Vladas Razas
Ranch Hand

Joined: Dec 02, 2003
Posts: 385
This one sounds fishy "A client can pass his local object reference to another application through its local inteface".
 
Consider Paul's rocket mass heater.
 
subject: EJB can local bean invoke business methods on remote interface passed from other JVM?
 
Similar Threads
Remote and Local Interfaces
A question about the client view
page 168 question 3
question about the way entity bean works?
This might be a hard question. on EJB