• Post Reply Bookmark Topic Watch Topic
  • New Topic

Bean Talking to Other Server  RSS feed

 
Ravi Verma
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I am in a situation where A Bean should talk to the other java based server and vice versa(back and forth) which is communication thru TCP(ServerSockets), My requirement is how to make them communicate to interchance the Data.
I am urgently need this help.
Thanks in Advance
Ravi
------------------
Ravi
 
Tim Holloway
Bartender
Posts: 18715
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What you want is a basic violation of the EJB architectural rules. There are a number of reasons why EJBs aren't allowed to use sockets and they're listed in the spec.
Aside from the technical reasons, EJBs are supposed to be callable components, not calling ones, except to be able to call other EJBs.
In general, any sort of socket services are supposed to be used by the EJB's client (often a servlet or JSP), not the EJB itself. There are 2 exceptions:
1. An EJB will implicitly use network facilities if invokes an EJB on another server. This is OK, because it uses the synchronous remote call mechanism of its container. The container is allowed things that the EJB itself is forbidden. One reason the EJB IS forbidden is to avoid damaging the internal contexts of the container.
2. In EJB2.0, a Message Driven Bean can be used for asynchronous services - this is a one-way trip, however.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!