I suspect you've touched upon a subtle bug involving the translation
of Java anonymous inner-classes and JavaScript garbage collection.
There is a subtle co-dependency between the anonymous Timer and the
anonymous AsyncCallback inner-classes that may be preventing the
garbage collector from collecting those classes -- which are created
"on the stack" of their respective methods.

I suggest simply skirting the issue by combining the two classes like
so, into a private inner-class (note I did not syntax check this):

private class CheckJob extends Timer implements AsyncCallback<Job> {
   private int checkJobRetries = 0;

   @Override
   public void run() {
      if (++checkJobRetries < SOME_LIMIT) {
         checkJobSvc.checkJob(currJobId, this);
      }
      else {
         // give up
      }
   }

   public void onFailure(Throwable caught) {
      this.schedule(TIMER_INTERVAL);
   }

   public void onSuccess(Job job) {
      if (job.hasFinished()) {
         //  blah, blah, blah...
         return;
      }
      updateProgress(job);
      this.schedule(TIMER_INTERVAL);
   }
}

On the submit click, create a CheckJob instance and schedule it:

CheckJob cj = new CheckJob();
cj.schedule(TIMER_INTERVAL);

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to