Package center.task

Examples of center.task.State


      tsk = tasks_all.get(id);
      if (tsk == null)
        return 0;
    }
    synchronized(tsk) {
      State st = tsk.status_id;
      if (State.SCHEDULED.equals(st))
        return tsk.id;
      if (State.BLOCKED.equals(st)) {
        tsk.status_id = State.SCHEDULED;
        return tsk.id;
View Full Code Here


    synchronized(tasks_all) {
      tsk = tasks_all.get(id);
      if (tsk == null)
        return 0;
    }
    State st;
    synchronized(tsk) {
      st = tsk.status_id;
      if (State.BROKEN.equals(st))
        return tsk.id;
    }
    if (st.equals(State.BREAKING) && subject_id == tsk.processor_id) {
      synchronized(tasks_processing) {
        tasks_processing.remove(id);
      }
      synchronized(tasks_finished) {
        tasks_finished.put(tsk.id, tsk);
View Full Code Here

    synchronized(tasks_all) {
      tsk = tasks_all.get(id);
      if (tsk == null)
        return 0;
    }
    State st;
    synchronized(tsk) {
      st = tsk.status_id;
      if (State.CANCELED.equals(st))
        return tsk.id;
    }
    if (st.equals(State.CREATED) && subject_id == tsk.initiator_id) {
      synchronized(tasks_created) {
        tsk = tasks_processing.remove(id);
      }
      if (tsk != null) {
        synchronized(tasks_finished) {
          tasks_finished.put(tsk.id, tsk);
        }
        synchronized(tsk) {
          tsk.status_id = State.BROKEN;
        }
        return tsk.id;
      }
    }
    if (st.equals(State.READY) && subject_id == tsk.initiator_id) {
      synchronized(tasks_ready) {
        tsk = tasks_processing.remove(id);
      }
      if (tsk != null) {
        synchronized(tasks_finished) {
View Full Code Here

          }
          tasks.put(first);
          process_subjects();
          continue;
        }
        State st;
        long dt;
        synchronized(tsk) {
          st = tsk.status_id;
          dt = tsk.dt_arch;
        }
        if (st.getType().equals(TypeOfState.LAST)
            && System.currentTimeMillis() > dt + 1000L*60L) {
          synchronized(tasks_finished) {
            tasks_finished.remove(tsk.id);
          }
          synchronized (prms) {
View Full Code Here

      Process prc = Process.currentProcess();
      while (true) {
        try {
          if (prc.isWillBreak())
            return State.BROKEN;
          State st = cntx.ta.getState(cntx.id_task);
          if (st.getType().equals(TypeOfState.LAST))
            return st;
          if (st.equals(State.BREAKING))
            return State.BROKEN;
        } catch (SysException ex) {
          ex.printStackTrace();
        }
        Thread.sleep(2000);// !!!
View Full Code Here

TOP

Related Classes of center.task.State

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.