This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes Asynchronous communication among clients? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Asynchronous communication among clients?" Watch "Asynchronous communication among clients?" New topic
Author

Asynchronous communication among clients?

L Chan
Greenhorn

Joined: Apr 29, 2004
Posts: 6
Hi,
I'm relatively new to J2EE...so bear with me if I'm using incorrect terminology...
Anyway, I'd like to know if there's a way (in effect) to communicate among client applications within the J2EE framework. For example, let's say we have three Swing client applications. Each Swing client is associated with a stateful session bean. In turn, all three of these stateful session beans is associated with only one entity bean. A client could call business methods on the stateful session bean which in turn calls a setter method that updates/changes the state of an entity in a persistence store. Or to make the example even easier, forget about the stateful session bean and just envision an example of three Swing clients and one entity bean...
However, I want changes to this entity to be communicated back to the other two Swing clients (e.g. the Swing client updates some information in its window). How can I do this using only J2EE concepts and techniques without resorting to creating sockets, threads, listeners, etc.? Is this even possible in J2EE (I've been told this isn't possible)?
L Chan
Greenhorn

Joined: Apr 29, 2004
Posts: 6
BTW, I forgot to mention that I'd like a solution that doesn't involve some sort of constant refresh (let's say every second) of the Swing client (i.e. the client uses a getter method to get method information from the session/entity bean). This is probably not very scalable.
C. Nimo
Ranch Hand

Joined: Mar 23, 2004
Posts: 82
Hi.
I suppose your best option is to use JMS for messaging your updates to the clients.
Nimo.
L Chan
Greenhorn

Joined: Apr 29, 2004
Posts: 6
Originally posted by C. Nimo:
Hi.
I suppose your best option is to use JMS for messaging your updates to the clients.
Nimo.

But I thought that only client beans can subscribe to these updates (as a topic)? However, a Swing client itself cannot subscribe to them. I thought about using this previously - let's assume the session beans can subscribe to the messages - how will it be able to relay this change back to the Swing client without using constant refreshes and stay within the J2EE framework (no writing of threads, sockets, etc.)?
Roland Barcia
author
Ranch Hand

Joined: Apr 15, 2004
Posts: 181
In stand alone clients, you can use a regualr JMS Listener to recieve asynchronous request. An EJB can write to w JMS queue and send it to a stand alone Java App as long as they share the same queueing system.


Roland Barcia: IBM Distinguished Engineer, CTO Mobile for Lab Services
L Chan
Greenhorn

Joined: Apr 29, 2004
Posts: 6
Originally posted by Roland Barcia:
In stand alone clients, you can use a regualr JMS Listener to recieve asynchronous request. An EJB can write to w JMS queue and send it to a stand alone Java App as long as they share the same queueing system.

Thanks for all the help, guys! Yes, a regular JMS listener will work - didn't think about that - but then again, that's why I'm a novice. Thanks!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Asynchronous communication among clients?
 
Similar Threads
My SCEA Part 1Study Notes
EJB Object
Reentrant okay in BDOM?
EJB 3.0 remove Entity
Quick question...