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

PortableRemoteObject.narrow()

 
Ram Pathan
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • 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.
 
Chengwei Lee
Ranch Hand
Posts: 884
  • Mark post as helpful
  • send pies
  • 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.
 
sawan parihar
Ranch Hand
Posts: 250
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic