• Post Reply Bookmark Topic Watch Topic
  • New Topic

Chptr 3 (Client View): Confused with getHandle()

 
Vijay Gade
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Pardon me if the question is dumb. In HFEJB, page 139, The Client View, the book mentions that the client code would have something like:

Handle h = this.restoreTheHandle();

and then,

Objec o = h.getEJBObject(); //etc etc...

I did not understand what goes on inside the restoreTheHandle() method. How do we restore the handle before calling the getEJBObject() method?

Thanks a lot,
-Vijay
 
paresh vernekar
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Handle is a serializable object that you can serialize and use to retrieve a reference to EJBObject later instead of going through the whole lookup and create process.The theRestoreHandle() method may contain some logic to retrieve the handle from wherever it was serialized, maybe a database or some other storage, and through it get a reference to the required remote component interface
 
Vijay Gade
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Paresh.
-Vijay
 
kumari Jain
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
You can probably look at a sample code given in the ejb spec 2.0 ,page 123
to understand how handles are used.

regards,
kumari
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!