JBoss still uses the remote interfaces of ejb 2 (that is what you ask for) but the invocation has local interface semantics since, inside the vm, objects are not copied by jboss on a call through the remote interfaces.
david jencks On 2003.06.18 05:47 "Burns, Jamie" wrote: > Thanks for your replies Scott and Dan. > > My understanding of what is being said... > > I have an EJB 1 in EAR A that wants to reference EJB 2 in EAR B where > both > EARs are deployed in the same VM. According to the EJB spec, l cant use > local interfaces to do this because the specs ejb-local-ref doesnt > accomdate > this. According to the EJB spec, l CAN use remote interfaces to do this > because ejb-ref does accomodate this. > > When l use remote interfaces to create the link between the two EJB's, l > use > ejb-ref in EJB 1's ejb-jar.xml to reference the remote interface of EJB > 2. I > also use ejb-ref/jndi-name in EJB 1's jboss.xml to reference the JNDI > name > in the global namespace of EJB 2's remote interface. > > Because both applications are in the same VM, JBoss uses the local > interfaces of EJB 2 instead of the remote interfaces. > > So EJB 1's deployment descriptors would be, > > [ejb-jar.xml] > > <entity> > <ejb-name>EJB1</ejb-name> > ... > <ejb-ref> > <ejb-ref-name>ejb/EJB2</ejb-ref-name> > <ejb-ref-type>Session</ejb-ref-type> > <home>com.company.EJB2RemoteHome</home> > <remote>com.company.EJB2Remote</remote> > </ejb-ref> > </entity> > > [jboss.xml] > > <entity> > <ejb-name>EJB1</ejb-name> > ... > <ejb-ref> > <ejb-ref-name>ejb/EJB2</ejb-ref-name> > <jndi-name>EJB2RemoteHome</jndi-name> > </ejb-ref> > </entity> > > > And EJB 2's descriptors would be, > > [ejb-jar.xml] > > <session > > <ejb-name>EJB2</ejb-name> > <home>com.company.EJB2RemoteHome</home> > <remote>com.company.EJB2Remote</remote> > ... > </session> > > [jboss.xml] > > <session> > <ejb-name>EJB2</ejb-name> > <jndi-name>EJB2RemoteHome</jndi-name> > ... > </session> > > > Is this correct? > > Thanks > > > -----Original Message----- > From: Scott M Stark [mailto:[EMAIL PROTECTED] > Sent: Tuesday, June 17, 2003 4:52 PM > To: [EMAIL PROTECTED] > Subject: Re: [JBoss-user] EJB reference to external EJB > > > This cannot be done, the ejb-link has to refer to an ejb in the same > application. The > overhead introduced by the remote interface is optimized away by default > so > its a > minor performance issue when the caller and callee are in the same vm. > > xxxxxxxxxxxxxxxxxxxxxxxx > Scott Stark > Chief Technology Officer > JBoss Group, LLC > xxxxxxxxxxxxxxxxxxxxxxxx > > ----- Original Message ----- > From: Burns, Jamie > To: '[EMAIL PROTECTED]' > Sent: Tuesday, June 17, 2003 4:37 AM > Subject: RE: [JBoss-user] EJB reference to external EJB > > > Ok. That works. Thanks Dan. > > Now l am using remote interfaces between applications in the same VM. In > this situation l want the performance benefits of using local interfaces. > > > Ive had a look in the EJB spec and there doesnt seem to be anything in > there > to say an application cant have a local ref to an EJB in another > application > in the same VM. Im assuming the ejb-link element is available as a > convenience. > > Is anyone able to provide some ejb-jar.xml and jboss.xml that shows an > EJB > in one application with a local ref to an EJB in another application in > the > same VM? > > Thanks. > > ******************************************************************************** > This electronic mail system is used for information purposes and is > not intended to form any legal contract or binding agreement. > The content is confidential and may be legally privileged. Access > by anyone other than the addressee(s) is unauthorised and any > disclosure, copying, distribution or any other action taken in > reliance on it is prohibited and maybe unlawful > > All incoming and outgoing e-mail communications and attachments > are scanned automatically by software designed to detect and remove > any material containing viruses or other unauthorised content. While > we undertake best endeavours to ensure that this content checking > software is up to date, recipients should take steps to assure > themselves > that e-mails received are secure. > *************************************************************************************** > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> > <HTML> > <HEAD> > <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"> > <META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12"> > <TITLE>RE: [JBoss-user] EJB reference to external EJB</TITLE> > </HEAD> > <BODY> > > <P><FONT SIZE=2>Thanks for your replies Scott and Dan.</FONT> > </P> > > <P><FONT SIZE=2>My understanding of what is being said...</FONT> > </P> > > <P><FONT SIZE=2>I have an EJB 1 in EAR A that wants to reference EJB 2 in > EAR B where both EARs are deployed in the same VM. According to the EJB > spec, l cant use local interfaces to do this because the specs > ejb-local-ref doesnt accomdate this. According to the EJB spec, l CAN use > remote interfaces to do this because ejb-ref does accomodate > this.</FONT></P> > > <P><FONT SIZE=2>When l use remote interfaces to create the link between > the two EJB's, l use ejb-ref in EJB 1's ejb-jar.xml to reference the > remote interface of EJB 2. I also use ejb-ref/jndi-name in EJB 1's > jboss.xml to reference the JNDI name in the global namespace of EJB 2's > remote interface.</FONT></P> > > <P><FONT SIZE=2>Because both applications are in the same VM, JBoss uses > the local interfaces of EJB 2 instead of the remote > interfaces.</FONT></P> > > <P><FONT SIZE=2>So EJB 1's deployment descriptors would be,</FONT> > </P> > > <P><FONT SIZE=2>[ejb-jar.xml]</FONT> > </P> > > <P><FONT SIZE=2><entity></FONT> > <BR><FONT SIZE=2> <ejb-name>EJB1</ejb-name></FONT> > <BR><FONT SIZE=2> ...</FONT> > <BR><FONT SIZE=2> <ejb-ref></FONT> > <BR><FONT SIZE=2> <ejb-ref-name>ejb/EJB2</ejb-ref-name></FONT> > <BR><FONT SIZE=2> <ejb-ref-type>Session</ejb-ref-type></FONT> > <BR><FONT SIZE=2> <home>com.company.EJB2RemoteHome</home></FONT> > <BR><FONT SIZE=2> <remote>com.company.EJB2Remote</remote></FONT> > <BR><FONT SIZE=2> </ejb-ref></FONT> > <BR><FONT SIZE=2></entity> </FONT> > </P> > > <P><FONT SIZE=2>[jboss.xml]</FONT> > </P> > > <P><FONT SIZE=2><entity></FONT> > <BR><FONT SIZE=2> <ejb-name>EJB1</ejb-name></FONT> > <BR><FONT SIZE=2> ...</FONT> > <BR><FONT SIZE=2> <ejb-ref></FONT> > <BR><FONT SIZE=2> <ejb-ref-name>ejb/EJB2</ejb-ref-name></FONT> > <BR><FONT SIZE=2> <jndi-name>EJB2RemoteHome</jndi-name></FONT> > <BR><FONT SIZE=2> </ejb-ref></FONT> > <BR><FONT SIZE=2></entity></FONT> > </P> > <BR> > > <P><FONT SIZE=2>And EJB 2's descriptors would be,</FONT> > </P> > > <P><FONT SIZE=2>[ejb-jar.xml]</FONT> > <BR><FONT SIZE=2> </FONT> > <BR><FONT SIZE=2><session ></FONT> > <BR><FONT SIZE=2> <ejb-name>EJB2</ejb-name></FONT> > <BR><FONT SIZE=2> <home>com.company.EJB2RemoteHome</home></FONT> > <BR><FONT SIZE=2> <remote>com.company.EJB2Remote</remote></FONT> > <BR><FONT SIZE=2> ...</FONT> > <BR><FONT SIZE=2></session></FONT> > </P> > > <P><FONT SIZE=2>[jboss.xml]</FONT> > <BR><FONT SIZE=2> </FONT> > <BR><FONT SIZE=2><session></FONT> > <BR><FONT SIZE=2> <ejb-name>EJB2</ejb-name></FONT> > <BR><FONT SIZE=2> <jndi-name>EJB2RemoteHome</jndi-name></FONT> > <BR><FONT SIZE=2> ...</FONT> > <BR><FONT SIZE=2></session></FONT> > <BR><FONT SIZE=2> </FONT> > </P> > > <P><FONT SIZE=2>Is this correct?</FONT> > </P> > > <P><FONT SIZE=2>Thanks</FONT> > </P> > <BR> > > <P><FONT SIZE=2> -----Original Message-----</FONT> > <BR><FONT SIZE=2>From: Scott M Stark [<A > HREF="mailto:[EMAIL PROTECTED]">mailto:[EMAIL PROTECTED]</A>] > </FONT> > <BR><FONT SIZE=2>Sent: Tuesday, June 17, 2003 4:52 PM</FONT> > <BR><FONT SIZE=2>To: [EMAIL PROTECTED]</FONT> > <BR><FONT SIZE=2>Subject: Re: [JBoss-user] EJB reference to external > EJB</FONT> > </P> > <BR> > > <P><FONT SIZE=2>This cannot be done, the ejb-link has to refer to an ejb > in the same application. The</FONT> > <BR><FONT SIZE=2>overhead introduced by the remote interface is optimized > away by default so its a</FONT> > <BR><FONT SIZE=2>minor performance issue when the caller and callee are > in the same vm.</FONT> > </P> > > <P><FONT SIZE=2>xxxxxxxxxxxxxxxxxxxxxxxx</FONT> > <BR><FONT SIZE=2>Scott Stark</FONT> > <BR><FONT SIZE=2>Chief Technology Officer</FONT> > <BR><FONT SIZE=2>JBoss Group, LLC</FONT> > <BR><FONT SIZE=2>xxxxxxxxxxxxxxxxxxxxxxxx</FONT> > </P> > > <P><FONT SIZE=2>----- Original Message ----- </FONT> > <BR><FONT SIZE=2>From: Burns, Jamie </FONT> > <BR><FONT SIZE=2>To: '[EMAIL PROTECTED]' </FONT> > <BR><FONT SIZE=2>Sent: Tuesday, June 17, 2003 4:37 AM</FONT> > <BR><FONT SIZE=2>Subject: RE: [JBoss-user] EJB reference to external > EJB</FONT> > </P> > <BR> > > <P><FONT SIZE=2>Ok. That works. Thanks Dan.</FONT> > </P> > > <P><FONT SIZE=2>Now l am using remote interfaces between applications in > the same VM. In this situation l want the performance benefits of using > local interfaces. </FONT></P> > > <P><FONT SIZE=2>Ive had a look in the EJB spec and there doesnt seem to > be anything in there to say an application cant have a local ref to an > EJB in another application in the same VM. Im assuming the ejb-link > element is available as a convenience.</FONT></P> > > <P><FONT SIZE=2>Is anyone able to provide some ejb-jar.xml and jboss.xml > that shows an EJB in one application with a local ref to an EJB in > another application in the same VM?</FONT></P> > > <P><FONT SIZE=2>Thanks.</FONT> > </P> > > <FONT SIZE=3 > COLOR=BLUE><PRE>******************************************************************************** > This electronic mail system is used for information purposes and is > not intended to form any legal contract or binding agreement. > The content is confidential and may be legally privileged. Access > by anyone other than the addressee(s) is unauthorised and any > disclosure, copying, distribution or any other action taken in > reliance on it is prohibited and maybe unlawful > > All incoming and outgoing e-mail communications and attachments > are scanned automatically by software designed to detect and remove > any material containing viruses or other unauthorised content. While > we undertake best endeavours to ensure that this content checking > software is up to date, recipients should take steps to assure > themselves > that e-mails received are secure. > *************************************************************************************** > </PRE></FONT> > </BODY> > </HTML> > ------------------------------------------------------- This SF.Net email is sponsored by: INetU Attention Web Developers & Consultants: Become An INetU Hosting Partner. Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
