File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes EJBHome getEJBhome():narrowing is required here? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "EJBHome getEJBhome():narrowing is required here?" Watch "EJBHome getEJBhome():narrowing is required here?" New topic

EJBHome getEJBhome():narrowing is required here?

Prashant Neginahal
Ranch Hand

Joined: Sep 14, 2002
Posts: 77
Hi All,

Is narrowing required on return object(EJBHome) when we call getEJBHome() on EJBObject stub?

I assume this method usage is much less with stateless bean when compared to statefull bean and entity bean. Because we have different way of creating beans here which is NOT in statless bean.Hope i m right. If somebody has more information about this method usage, please share with me.


Thanks, <br />Prashant<br />SCJP, SCBCD
sawan parihar
Ranch Hand

Joined: Aug 24, 2004
Posts: 250
The narrow() method is used when a remote reference to an EJB home or EJB object is returned without a specific Remote interface type. That means in following cases:

1) when you do lookup
2) when getting home or remote interface from the handles.
3) Get the home from EJBMetaData
4)When getting EJB object in a collection returned by a Home interface finder method
5) EJB object is returned from any business method

Except these cases you don't ned narrow.

[ April 23, 2005: Message edited by: sawan parihar ]

Sawan<br />SCJP,SCWCD,SCBCD<br /> <br />Every exit is an entry somewhere.
Prashant Neginahal
Ranch Hand

Joined: Sep 14, 2002
Posts: 77
Thanks Sawan. But, any examples where this method is used for Stateless session bean.

wood burning stoves
subject: EJBHome getEJBhome():narrowing is required here?
It's not a secret anymore!