I doubt it catches browser window close or
nasty-ms-windows-
bsod
. 
Architecturally, it is correct to respond from the server, when it is asked for. Having an independent background process at server side for the user client is funny idea, since 1000 users will generate 1000 threads, then close their windows due various reasons (crash, mistake, intentionally, earth quake, moon phase, solar interference etc) and will generate one more time 1K threads after they back. So per 1K users I will have 2K threads. Oh wait, I would have also 1K threads from the appserver, since users are requesting me from the clients to update their UIs. So I will have 3K threads in total: 1K background threads, 1K lost background threads and 1K HTTP requests from users.
Whoa! That’s just seems to be plain wrong way, IMHO (as long as I am not missing anything).
You probably want to say to user exactly as much as you’re asked for. No more. That’s it: client is pinging server for, let’s say, message updates, like in Twitter (never using it, but take it as an example). So how you, guys, suggesting to implement Twitter monitor online? Let’s say, how to get new set of messages periodically? (implementing UI part is completely clear for me).
I would probably do these enhancements for ProgressIndicator (just an idea):
private ProgressIndicator justRefresher;
...
this.justRefresher = new ProgressIndicator();
// this combination would eliminate various tricks to do the same
this.justRefresher.setVisible(false);
this.justRefresher.setAlwaysActive(true);
this.justRefresher.setImmediate(true); // this would kick server instantly
this.justRefresher.setPollingInterval(5000); // We don't need that too often
this.justRefresher.addListener(new PollingListener() {
public void onIndicatorPoll() {
MyGreatApplication.this.getLatestNews();
}
});
What you think and why this idea must be bad? Goals are quite clear: no background dedicated thread, no ugly shamanic dance with a tambourine to make sure thread is terminated on time (well, almost on time, at its very best), it would be very easy to implement and, most important, closest sync with server and client (not the case if you have a background thread and client also polls updates). Basically, create a simple invisible Button that will click itself periodically. 
P.S. And how to stop the threads if user session over, BTW? Running a yet another thread that is just iterates through sessions and is ripping off whose session gone?..
In that case I will have 3001 thread. :lol: