Implementing alert push to a desktop...


General J2EE: Implementing alert push to a desktop...

  1. Implementing alert push to a desktop... (4 messages)


    I am trying to implement a server-to-desktop alert/content push in my web application. It is a typical web application, developed using jsp/servlets/ejbs. I would like to implement something like yahoo or gmail alerts. When certain events occurs on the server, I would like to send a notification to the a group of users where an alert icon is displayed in the system try. The user then can click on that icon to connect to the applicaion.

    Can some one suggest how can I implement this functionality?

    Regards and thanks in advance for your time.

  2. Hi Rajan;
    Your requirement must use Java Desktop Integration Cmponents technology. There are defenitly many ways to implement such a solution and it can be completly platform independent as well.

    Please check the following links, i think it might be useful.

  3. Jyothish,
    Thank you for your response.
    Yes, I have looked at JDIC and as you pointed out I'll have to use it to keep my application running on a desktop.

    I am not sure whether has support for listening to alerts.
    When mail is received at my yahoo account, popup is displayed on my desktop.

    Do I have to implement a small server on a desktop where my server side application and post a request? Something like a lightweight http server listening on some port?

    Is there anything available that can assist me in quickly developing this application?

    Thanks for your help.

  4. Hi Rajan;
    You may write a small server class which listens on a particular port ( on the desktop application), and make the server connect to it whenever some changes occur in the server, via plain sockets and send data, but that will make you to cater for the numerous clients / firewall/proxies etc where the clients may reside etc.

    I dont think that would be a good solution.

    One solution which I can think of , is to expose a webservice from the Server, and make your client/desktop application poll the server(ie, invoke the webservice) on regular intervals (say every 5 minutes) and the webservice can return values accordingly and if there are some values, you can launch a browser from the tray desktop app (there are ways to do it), with a unique session ID to identify each client as authenticated and do your additional stuff accordingly.
    Any corrections are welcome.
  5. Jyothish,

    I think this is what I have been thinking as well.
    I can't have server sending a request to each client. That would need a broadcast mechanism on my server and a registry of all clients. I think I will have to have clients to poll periodically. Thanks for your time and valuable comments.