aspose 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 Spring in Action this week in the Spring 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".
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EJB can local bean invoke business methods on remote interface passed from other JVM?