Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need more detail of PortableRemoteObject.narrow

 
Junglee Hippie
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Gaurav Chugh
Ranch Hand
Posts: 50
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
bala nannaka
Ranch Hand
Posts: 49
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • 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/
 
Raghu Shree
Ranch Hand
Posts: 143
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic