• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

About Handle & Remote Object Reference

 
ericlee
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In EJB Client we can get Handle object from EJBObject interface
and pass it to different JVM to rebind the EJBObject in the server,
EJBObject remote reference can also be passed to different server.
what's difference between to hold Handle or Remote Object Reference??
Thank's a lot ^_^!
[ October 28, 2003: Message edited by: ericlee ]
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
EJBHandle is serializable.
 
ericlee
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Pradeep Bhat:
EJBHandle is serializable.

thank's for your reply ^_^
but,Remote Object Reference (Stub) is serializable too!!!
[ October 28, 2003: Message edited by: ericlee ]
[ October 28, 2003: Message edited by: ericlee ]
 
Kathy Sierra
Cowgirl and Author
Rancher
Posts: 1589
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy -- if I understand your question, the EJBObject reference *can* be passed as part of a remote method call, so that means it *can* be passed into a different JVM, but that is a runtime thing, guaranteed by normal RMI semantics.
BUT... there is no guarantee that you can serialize the remote reference, say, email it to somebody, and have them deserialize it into something they can use later to re-establish a connection to the server. The vendor is free to implement the remote reference any way that it likes (it isn't *required* to use rmic-generated stubs, for example), and while with many servers you CAN serialize and re-use the EJBObject reference as you would a Handle, it just isn't guaranteed. Handles exist as a *guaranteed* portable way to get back something that *behaves* as though it were your original reference.
I hope that makes sense.
cheers,
Kathy
 
ericlee
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Kathy Sierra:
Howdy -- if I understand your question, the EJBObject reference *can* be passed as part of a remote method call, so that means it *can* be passed into a different JVM, but that is a runtime thing, guaranteed by normal RMI semantics.
BUT... there is no guarantee that you can serialize the remote reference, say, email it to somebody, and have them deserialize it into something they can use later to re-establish a connection to the server. The vendor is free to implement the remote reference any way that it likes (it isn't *required* to use rmic-generated stubs, for example), and while with many servers you CAN serialize and re-use the EJBObject reference as you would a Handle, it just isn't guaranteed. Handles exist as a *guaranteed* portable way to get back something that *behaves* as though it were your original reference.
I hope that makes sense.
cheers,
Kathy

Oh!!!Thank Kathy
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
while with many servers you CAN serialize and re-use the EJBObject reference as you would a Handle, it just isn't guaranteed.

Why is there no guarantee?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic