Re: [JBoss-user] using PortableRemoteObject.narrow
Hi. For JBoss as with many app/ejb servers both are valid. However the second is not valid on some RMI-IIOP servers (IAS/BAS at least). If you want speed and lower your portability use the second (no PortableRemoteObject). If you want portability... Well... A narrow is needed to use the stub/skeletons. That is also true for the JRMP protocol. Most of the protocols that require stubs/skeletons/handlers/helpers/operations. These have to be narrowed in order to receive a local interface implementation. Lachezar. I keep seeing code samples that use the followng syntaxt: Object ref = ctx.lookup(EJBHome.JNDI_NAME); EJBHome home = (EJBHome) PortableRemoteObject.narrow(ref, EJBHome.class); I also see other samples that use the following: EJBHome home Object ref = (EJBHome) ctx.lookup(EJBHome.JNDI_NAME); What is the correct format in JBoss (I have used the latter) /t Toby Hede ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] using PortableRemoteObject.narrow
The first is necessary if you are using a protocol other than JRMP on the wire. JRMP is the default with JBoss, so the second form will work for you. However, if you may be switching to another protocol (eg RMI-IIOP), you should use the first. Hanna Khamis -Original Message- From: Toby Hede [mailto:[EMAIL PROTECTED]] Sent: Friday, July 27, 2001 07:59 To: [EMAIL PROTECTED] Subject:[JBoss-user] using PortableRemoteObject.narrow I keep seeing code samples that use the followng syntaxt: Object ref = ctx.lookup(EJBHome.JNDI_NAME); EJBHome home = (EJBHome) PortableRemoteObject.narrow(ref, EJBHome.class); I also see other samples that use the following: EJBHome home Object ref = (EJBHome) ctx.lookup(EJBHome.JNDI_NAME); What is the correct format in JBoss (I have used the latter) /t Toby Hede ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] using PortableRemoteObject.narrow
The correct form is: MyBeanHome home = (EJBHome) PortableRemoteObject.narrow( ctx.lookup(JNDI_NAME), MyBeanHome.class); cheesr dim On Fri, 27 Jul 2001, Toby Hede wrote: I keep seeing code samples that use the followng syntaxt: Object ref = ctx.lookup(EJBHome.JNDI_NAME); EJBHome home = (EJBHome) PortableRemoteObject.narrow(ref, EJBHome.class); I also see other samples that use the following: EJBHome home Object ref = (EJBHome) ctx.lookup(EJBHome.JNDI_NAME); What is the correct format in JBoss (I have used the latter) /t Toby Hede ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user