• 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

PortableRemoteObject.

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What does PortableRemoteObject.narrow does.
Can i have some breif overview of it.
Regards,
aakash
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
When using RMI-IIOP, u can't simply cast an object u recieve over the network, because the stub class file may not exist with the client.RMI-IIOP does not allow downloadable class files as CORBA does not support it.
So u need to safe cast by calling PortableRemoteObject.narrow(). This static method converts the object to the desired remote interface 4 u.Pass to narrow() the object u desire to cast and the class to which u wish to cast.The narrow() method returns the resultant object or will throw an exception.
Hope this answer ur query.
Praveen
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The narrow method returns a java.lang.Object instead of an OMG object. it is needed to call this method to hold some additional needed informations like the
IOR(reference to the remote object).
If you simply cast the object there can appear some strange errors cause he calls wrong objects and so on
 
money grubbing section goes here:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic