File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why dont we need to narrow the EJBObject stub reference

 
manish ahuja
Ranch Hand
Posts: 312
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 29
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
manish ahuja
Ranch Hand
Posts: 312
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic