• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Asynchronous communication among clients?

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi.
I suppose your best option is to use JMS for messaging your updates to the clients.
Nimo.
 
L Chan
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.)?
 
author
Posts: 181
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
L Chan
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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!
 
reply
    Bookmark Topic Watch Topic
  • New Topic