• 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
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

PortableRemoteObject.narrow()

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I didnt quite get y we call this on the object returned from the JNDI.
Can some one please explain ??

Thanks in advance.
 
Ranch Hand
Posts: 884
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Kituz Pathangi:
Hi,

I didnt quite get y we call this on the object returned from the JNDI.
Can some one please explain ??

Thanks in advance.



In short, so that we can be sure that the object we're getting is the home interface. Reason being the protocol could be CORBA-IIOP instead of JRMP. There is no performance issue in using this method. It doesn't make your code slower or uses more resources, does you more good than harm in using it.
 
Ranch Hand
Posts: 250
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
You need to narrow because your container may be using RMI-IIOP and the retured object is not guranteed to be something that implements your home interface. By narrowing you are just making sure that whatever you are getting does implement the home interface.

Hope that helps.

Sawan
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic