This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • 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
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic