Spec, 5.4:
Narrowing remote types requires the use of javax.rmi.PortableRemoteObject.
narrow rather than Java language casts. => if you have a local client view (means, your home-interface inherits from javax.ejb.EJBLocalHome) you can (or must?) cast. If you have a remote client view (...inherits from javax.ejb.EJBHome), you must narrow.
Narrowing comes historically from the IIOP protocol, a protocol defined by OMG for CORBA-services. RMI/IIOP (the today's remote protocol implementation for
EJB's) is based on this protocol. Since local clients are not involved in RMI, you can (or must) simple cast after a lookup.
It
may be that you can use only a cast for the remote client view, if the client and the server are running in the same container, but that's server dependet and then, your application is not a "pure J2EE-APP".
Severin