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.
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.
Joined: Apr 09, 2007
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.
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/
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.
Raghu J<br />SCJP 1.4<br /> <br />The Wind and waters are always<br />on the side of the ablest navigators.<br /><a href="http://groups.yahoo.com/group/scjp_share" target="_blank" rel="nofollow">SCJP Group</a><br /><a href="http://groups.yahoo.com/group/JavaBeat_SCWCD" target="_blank" rel="nofollow">SCWCD Group</a>