Пример #1
0
  public void worked(int work, String msg) throws MonitorCanceledException {
    MON.checkMonitor(this);
    checkWork(work);

    this.work += work;
    message(msg);
  }
Пример #2
0
 protected void message(String msg, int level) {
   if (parent != null) {
     parent.message(msg, level + 1);
   } else {
     trace(msg, level, false);
   }
 }
Пример #3
0
 public void join(String msg) throws MonitorCanceledException {
   MON.checkMonitor(this);
   MON.setMonitor(parent);
   parent.setChild(null);
   parent.message(msg);
   done();
 }
Пример #4
0
  public void fork(int workFromParent, Runnable runnable, String msg)
      throws MonitorCanceledException {
    MON.checkMonitor(this);
    checkWork(workFromParent);

    child = subMonitor(workFromParent);
    MON.setMonitor(child);

    try {
      runnable.run();
    } finally {
      MON.checkMonitor(child);
      MON.setMonitor(this);
      child.done();
      child = null;
    }

    work += workFromParent;
    message(msg);
  }
Пример #5
0
 public void message(String msg) {
   if (msg != null) {
     message(msg, 0);
   }
 }