Hi,
I guess this is more of a design question than a programming one but is related to
servlets...
In our application, Javawebstart GUI - Servlet (Jetty), our server sends a lot of 'events' to keep the GUI uptodate of the changes at the backend. Events are nothing but XML messages containing objects translated to XML sent out as http chunks asynchronoulsy.
Now since our application has grown we have 100 and 1000s of these events flooding the GUI.
I was wondering how people handle the following,
1. How do you keep clients updated with asynchronous changes caused due to other interfaces or other threads on the server.
2. When a cilent request comes in and you want to return immediately since the operation reqesut is time-consuming you spawn a
thread from the reques thread and let the request thread complete. How do you later detemine how to and when to update the client with what has changed. Is there a standard way of doign it..like some design
pattern, strategies etc.
3. Events in our case are thrown at several levels - one level directly below the servlet or serveral levels below it. If a call comes from servlet I dont want my lower layers to throw event, my servlet shall do it. But call to lowerlayers can come from places other than a servlet like seperate threads in the app etc. Is there a standard way or popular way of differentiating such calls.
Thanks in advance.