Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Shall we cast EJBObject.getEJBHome()?

 
alzamabar
Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, the EJBObject interface exposes the following method:

public EJBHome getEJBHome()

If my client wants to use this method, shall it cast the returned object to the bean's home interface type? If so, should it 'narrow' the returned object, or would a simple cast be enough?

Cheers,

Marco
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Section 6.10:

A client program that is intended to be interoperable with all compliant EJB Container implementations must use the javax.rmi.PortableRemoteObject.narrow(...) method to perform
type-narrowing of the client-side representations of the remote home and remote interfaces.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic