• 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.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!