----- Original Message -----
From: "Eric Hodges" <[EMAIL PROTECTED]>
To: "Orion-Interest" <[EMAIL PROTECTED]>
Sent: Monday, February 05, 2001 8:07 PM
Subject: Re: EJB's talking between applications.


>
> ----- Original Message -----
> From: "Trond Nilsen" <[EMAIL PROTECTED]>
> To: "Orion-Interest" <[EMAIL PROTECTED]>
> Sent: Sunday, February 04, 2001 9:32 PM
> Subject: EJB's talking between applications.
>
>
> > Using the Calc bean and a standalone client, I've been successful
(running
> > the client on a different machine), but convincing the beans to talk to
> each
> > other within separate applications on the same server seems a lot
harder.
> As
> > an aside, if both beans are hosted within the same application, getting
> them
> > to talk is trivial.
>
> How do you do it?  How does one bean find an instance of another bean?

When they're both hosted in the same application, rather than in two
separate applications on the same server?

I'm pretty sure that's been covered elsewhere on the list (or am I reading
you wrong?), but anyway..

If I have two beans hosted in the same application (call them Caller and
Receiver), and I wanted one to talk to the other, I'd specify Caller in my
ejb-jar.xml file as follows

<session>
  <ejb-name>Caller</ejb-name>
  <home>net.aig.cma.CallerHome</home>
  <remote>net.aig.cma.Caller</remote>
  <ejb-class>net.aig.cma.CallerEJB</ejb-class>
  <session-type>Stateless</session-type>
  <ejb-ref>
    <ejb-ref-name>ejb/Receiver</ejb-ref-name
    <ejb-ref-type>Session</ejb-ref-type>
    <home>net.aig.cma.ReceiverHome</home>
    <remote>net.aig.cma.Receiver</remote>
  </ejb-ref>
</session>

then lookup a reference to it using the code in my original post.

Back to my query, has anyone managed to get two beans in separate
applications (whether on the same server, or not) talking to each other?

Trond.




Reply via email to