File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Notifying Client from a Server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Notifying Client from a Server" Watch "Notifying Client from a Server" New topic
Author

Notifying Client from a Server

natasha malhotra
Greenhorn

Joined: Dec 19, 2001
Posts: 1
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?
prav mane
Greenhorn

Joined: Nov 21, 2001
Posts: 16

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?

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Notifying Client from a Server