• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • 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
 
Attractive, successful people love this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic