• 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
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Need more detail of PortableRemoteObject.narrow

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Frndz,
I am new to EJB and just started preparing for BCD. I am unable to understand why do we use PortableRemoteObject.narrow.

Why is the need of narrowing,as I have gone through HFEJB also but could not make somethin solid out of that.

Please help... and explain.

Thanks in Advance
 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Even though i dont the reason for it, but i do know that it is something to do with narrowing like type casting and this is only done for the remote home object , if you see some other example for local client view , there narrowing is not required as it is already in same form for local home interface type. We will see somebody post reply on it.
 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
EJB uses rmi-iiop .that means every call is transferred into iiop format.
so you need to type cast the call into your own formatt.narrow method is used to type cast the object type into your required type.
 
Junglee Hippie
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply but this is all that is already there in the HFEJB, ne ways thanks a lot for the replies I would like to know the internal working of RMI-IIOP.
If anybody could help.

Thanks
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you're going for the exam, I think you should focus on what is in your book first, and dig deeper into the details afterwards.
You can still refer to the following site for documentation on RMI-IIOP :
http://java.sun.com/products/rmi-iiop/
 
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Using lookup method we can get the remote home object, we need to cast the return object to our desired remote home object. But we can�t explicity casting thsese object because of CORBA standards. (casting is not native). Java RMI-IIOP standards provides the PortbaleRemoteObject.narrow() method to casting the object to appropriate type.

Note: If we using Local interface we can do explicit casting as normal java way.
reply
    Bookmark Topic Watch Topic
  • New Topic