aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Why dont we need to narrow the EJBObject stub reference Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Why dont we need to narrow the EJBObject stub reference" Watch "Why dont we need to narrow the EJBObject stub reference" New topic
Author

Why dont we need to narrow the EJBObject stub reference

manish ahuja
Ranch Hand

Joined: Oct 23, 2003
Posts: 312
Hi All

With remote client view we need to narrow the remote home stub reference we retrieve from JNDI.

But when we retrieve the EJBObject stub reference by invoking a create () on the remote home object we never do a narrow on the EJBObject stub reference we receive.

Can somebody explain this. Why we need narrowing on a remote home stub reference but not on the remote ejbobject stub reference

Bye
Manish
Rajnish Bhasin
Greenhorn

Joined: Mar 01, 2004
Posts: 29
Becoz in case of EJBHome Narrowing what u r narrowing is a object of java.lang.Object and u r not sure what Object that might be in case of IIOP where interaction might be between Objects of diffrent Languages.
Where as in case of the EJBObject u dont need a narrow as u r already aware what u will get back i.e a object of the type of yr Remote Interface and not just java.lang.Object.

Hope it helps...


Best Regards,<br />Rajnish Bhasin.<br />SCJP<br />SCWCD<br />SCBCD
manish ahuja
Ranch Hand

Joined: Oct 23, 2003
Posts: 312
Hey Rajnish

Thanx for your response. I am still not getting this. When we say that the home object stub reference is not the same as the home interface which we want to cast to because of the IIOP wire protocol embellishes that object & hence narrowing is required.

So to my understanding the same rule even will even apply for an EJBObject stub reference. Even the EJBObject retrieved will pass through the same IIOP wire protocol. So how come that is exempt from narrowing.

When you say here
***********************
Where as in case of the EJBObject u dont need a narrow as u r already aware what u will get back i.e a object of the type of yr Remote Interface and not just java.lang.Object.
************************

even in case of EJBHome we know that the object reference we get back is a kind of our Remote Home interface but thats not the case as IIOP is in picture. So the same rule should be applicable to teh EJBObject reference also

Kindly ellaborate


Bye
Manish
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Why dont we need to narrow the EJBObject stub reference