This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Five Lines of Code and have Christian Clausen on-line!
See this thread for details.
Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

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

 
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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???
 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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,
 
Vladas Razas
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This one sounds fishy "A client can pass his local object reference to another application through its local inteface".
 
There's a hole in the bucket, dear Liza, dear Liza, a hole in the bucket, dear liza, a tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic