• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Paresh.
-Vijay
 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
pie. 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
reply
    Bookmark Topic Watch Topic
  • New Topic