• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Notifying Client from a Server

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
While using a Java Client Application and an app-server EJB based server in a client-server environment, how do we notify the client of a new message (for ex: a mailing application) from the server instead of the client polling the server in a scheduled time frame?
Here the implementation should be using EJB on the app-server and not standard Java Class. Can this be done using an EJB?
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

i don't work on EJBs. but i have read about them...so i'll try.
Is it a publisher-subscriber kind of a model??
then the client needs to register with the server / probably the way event listeners work in Java.
Server can notify the client when a certain even occurs through callback.
In your case, i guess the message needs to go to a specific client, then you need to put some logic while registering the client. say ask the client to send some kind of an identification. store the client reference against that id in a hash. So when an even occurs you can look up the hash with id and send the notification to that client
I have not used JMS (java message service), you should be using that. I think this is what it is for.
it has the concept of provider and subscribers.
am a newbie to ejb world so my suggestion might not be very correct.
prav.

Originally posted by natasha malhotra:
While using a Java Client Application and an app-server EJB based server in a client-server environment, how do we notify the client of a new message (for ex: a mailing application) from the server instead of the client polling the server in a scheduled time frame?
Here the implementation should be using EJB on the app-server and not standard Java Class. Can this be done using an EJB?


 
That which doesn't kill us makes us stronger. I think a piece of pie wouldn't kill me. Tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic