Right ! if the client is in other language then there is no EJB stuff coming into picture it will become a CORBA client and the corresponding semantics are applied in that scenario !! As you said in your case(1) though you call PortableRemoteObject.narrow(...) one still needs to cast it to XXXHome(in EJB). Everything said about point(1) of yours is correct. hope this helps !
Regards, kris -----Original Message----- From: Ashwani Kalra [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 10, 2002 2:49 PM To: [EMAIL PROTECTED] Subject: Re: PortableRemoteObject.narrow Hi kris, Thanks for this info. I have further doubts. (myclass) PortableRemoteObject.narrow(...) ..............................1 In above case even if I give narrow fn the Object, and the required class, still I have to downcast it to myclass. In CORBA, there will be appropriated helper class generated and you call the ||ar fn of the helper class. i.e. myclass a =helper.narrow(Object); ...............................................2 There is no need to downcast. Now suppose my client is not java or C++ and no casting is allowed (client written in other language say smaltalk or python) then (1) will fail. Am I right ?? --Ashwani ----- Original Message ----- From: "Ramakrishna N" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, October 10, 2002 1:05 PM Subject: Re: PortableRemoteObject.narrow > To be more clear, > The object(stub) that is in the JNDI Naming space has been > implemented in a language that is different from JAVA but a Java > Application(EJB Container) wants to make use of it, had it been java a > simple cast would have served the purpose but when the remote object(stub) > has been implemented in a different language and was made available through > Corba, there is much more one has to do (cast wont work) to check if that > exported object can act as our EJBHome and then convert the stub into a > class which can act like a normal java-stub and this is exactly what > happens in the implementation of the the PortableRemoteObject.narrow(...) > method, after it checking if casting would work. > Since we dont know the type of the exported stub we need to have a > util method which can tell us if that exported stub can act as our EJBHome > Stub and then to convert it accordingly and that method is what our > PortableRemoteObject.narrow(...) > Hope this helps ! > > Regards, > kris > > -----Original Message----- > From: Ashwani Kalra [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, October 09, 2002 4:03 PM > To: [EMAIL PROTECTED] > Subject: PortableRemoteObject.narrow > > > Hi, > Why its asked to use > PortableRemoteObject.narrow(home, home.class) > instead of just downcasting. The specs mention it is due to rmi-iiop > compatibility. > Can any body explain in more details about it. > > TIA > Ashwani Kalra > > =========================================================================== > To unsubscribe, send email to [EMAIL PROTECTED] and include in the body > of the message "signoff EJB-INTEREST". For general help, send email to > [EMAIL PROTECTED] and include in the body of the message "help". > > =========================================================================== > To unsubscribe, send email to [EMAIL PROTECTED] and include in the body > of the message "signoff EJB-INTEREST". For general help, send email to > [EMAIL PROTECTED] and include in the body of the message "help". > =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff EJB-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help". =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff EJB-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
