Ejemplo n.º 1
0
 protected GlowWorker(final GlowTask task, final GlowScheduler scheduler) {
   this.id = task.getTaskId();
   this.owner = task.getOwner();
   this.task = task;
   this.thread =
       new Thread(
           new Runnable() {
             public void run() {
               task.pulse();
               scheduler.workerComplete(GlowWorker.this);
             }
           });
   thread.start();
 }
Ejemplo n.º 2
0
 public void cancel() {
   if (thread == null) return;
   if (!thread.isAlive()) {
     thread.interrupt();
     return;
   }
   task.cancel();
 }
Ejemplo n.º 3
0
  public void run() {

    shouldContinue = task.pulse();
  }