communication between 2 beans on differnet servers
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Rima_Kilany
Posted On:   Tuesday, April 24, 2001 03:44 AM

how can i communicate between a bean1 running on server1 and a bean2
running on server2?

Object objref = initial.lookup("java:comp/env/ejb/MyListen");
Knowing that:
"MyListen" is the JNDI Name of the second bean.

this example is valid for 2 beans running on the same server

Re: communication between 2 beans on differnet servers

Posted By:   Shaun_Childers  
Posted On:   Tuesday, April 24, 2001 09:35 AM

Let's say that server1 has an IP=127.0.0.1, port 8001 and server2 has an IP=127.0.0.2, port 8001.
Now for bean1 or bean2 to be able to look up and get a reference to the other bean on the other server, you simply use the appropriate URL whenever you get the InitialContext to do the lookup. So for bean1 to look up bean2, it needs to get an InitialContext to the EJB server on running on the 127.0.0.2 server, which is listening on port 8001. Then bean1 can have the reference to bean2.
About | Sitemap | Contact