For portability purposes. Most AppServers accept a simple cast, but with
the advent of RMI over IIOP narrow should be since simple type-casts
might fail.
Craig Herder wrote:
> Hi,
>
> I am new to EJB. Could someone explain the following statement(s) in terms
> of why
> I need to typecast a generic object into the home interface type, using the
> narrow
> method? What's going on behind the scene here?
>
> Object boundObject = context.lookup("java:comp/env/ejb/HelloHome");
> helloHome = (HelloHome) PortableRemoteObject.narrow(boundObject,
> HelloHome.class);
>
> TIA,
>
> Craig Herder
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff EJB-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".