Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Page 57 (6.2.1) of EJB Spec !!!

 
Giju George
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"A client can pass a local home object reference to another application through its local interface. A local home object reference cannot be passed as an argument or result of a method on an enterprise bean�s remote home or remote interface"

Can't understand this point !!!

Does this means, a Client (this will most probably a bean) cannot pass local home object to a remote bean ???
[ June 21, 2004: Message edited by: Giju George ]
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A local home or component reference only makes sense in the context of the container in which the bean is running. Since a remote reference can be used by potentially any client (app or bean) outside of the container in which the bean is running, it does not make sense to let a remote interface pass around local reference because the local reference will not be of any use to the client using the remote interface. Remember that local interface make local calls and not RMI call. Thus, a local call will only work within the container. If you pass a local stub (i.e., reference to a local home or component interface) through the remote interface, the remote client will get a local stub which has no idea on how to marshall the method call since its job is to invoke methods by reference as in any normal Java program.
 
Giju George
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanx Valentin, that makes sense to me.....
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic