Package center.task

Examples of center.task.State


    logging = cntx.getPrmNvl("xml-parsing-log", false);
    return null;
  }

  public State process(Context cntx) throws TaskException, SysException, InterruptedException {
    State st = paramsValidateAndPrepare(cntx);
    if (st != null)
      return st;
    File x;
    InputStream r = null;
    if (file instanceof File)
View Full Code Here


  // public Reader getTaskParamLong(long id, String name) throws
  // RemoteException;

  public void getState(Object[] objs, HttpExchange httpExchange, ITaskAPI ta)
      throws SysException, IOException {
    State r = ta.getState(((Long) (objs[0])).longValue());

    StringBuffer sb = new StringBuffer();
    sb = Handler.getElementByObject(sb, r);
    byte[] rb = sb.toString().getBytes("utf-8");
View Full Code Here

  public void setState2(Object[] objs, HttpExchange httpExchange, ITaskAPI ta)
      throws SysException, IOException {
    long subject = ((Long) (objs[0])).longValue();
    long task = ((Long) (objs[1])).longValue();
    State st = (Null.equ(objs[2])) ? null : ((State) (objs[2]));
    Long processor = (Null.equ(objs[3])) ? null : ((Long) (objs[3]));
    long r = ta.setState(subject, task, st, processor);

    StringBuffer sb = new StringBuffer();
    sb = Handler.getElementByObject(sb, r);
View Full Code Here

    w.close();
  }

  public void waitFinished(Object[] objs, HttpExchange httpExchange, ITaskAPI ta)
      throws SysException, IOException {
    State r = ta.waitFinished(((Long) (objs[0])).longValue(),
        ((Long) (objs[1])), ((Long) (objs[2])));

    StringBuffer sb = new StringBuffer();
    sb = Handler.getElementByObject(sb, r);
    byte[] rb = sb.toString().getBytes("utf-8");
View Full Code Here

      }
    }
  }
  public State process(Context cntx) throws TaskException, SysException,
      InterruptedException {
    State st = paramsValidateAndPrepare(cntx);
    if (st != null)
      return st;
    Socket s = null;
    try {
      Map<String, Object> prms = cntx.getGroupParams(msg_grp_in);
View Full Code Here

      }
    }
  }
  public State process(Context cntx) throws TaskException, SysException,
      InterruptedException {
    State st = paramsValidateAndPrepare(cntx);
    if (st != null)
      return st;
    Socket s = null;
    try {
      Map<String, Object> prms = cntx.getGroupParams(msg_grp_in);
View Full Code Here

          return tsk.id;
        }
      }
      return 0;
    }
    State old_st;
    synchronized(tsk) {
      old_st = tsk.status_id;
      if (State.BREAKING.equals(old_st) || State.PROCESSING.equals(old_st)) {
        tsk.status_id = State.DONE_OK;
        tsk.notifyAll();
View Full Code Here

          return tsk.id;
        }
      }
      return 0;
    }
    State old_st;
    synchronized(tsk) {
      old_st = tsk.status_id;
      if (State.BREAKING.equals(old_st) || State.PROCESSING.equals(old_st)) {
        tsk.status_id = State.DONE_ERR;
        tsk.notifyAll();
View Full Code Here

    synchronized(tasks_all) {
      tsk = tasks_all.get(id);
      if (tsk == null)
        return 0;
    }
    State st;
    synchronized(tsk) {
      if (State.DONE_TOUT.equals(tsk.status_id))
        return tsk.id;
      if ((tsk.processor_id != subject_id) && (tsk.initiator_id != subject_id))
        return 0;
      if (TypeOfState.LAST.equals(tsk.status_id.getType()))
        return 0;
      st = tsk.status_id;
      tsk.status_id = State.DONE_TOUT;
      tsk.notifyAll();
    }
    if (st.equals(State.BREAKING) || st.equals(State.PROCESSING))
      synchronized(tasks_processing) {
        tasks_processing.remove(id);
      }
    else if (st.equals(State.CREATED))
      synchronized(tasks_created) {
        tasks_created.remove(id);
      }
    synchronized(tasks_finished) {
      tasks_finished.put(tsk.id, tsk);
View Full Code Here

      tsk = tasks_all.get(id);
      if (tsk == null)
        return 0;
    }
    synchronized(tsk) {
      State st = tsk.status_id;
      if (State.BREAKING.equals(st))
        return tsk.id;
      if (State.PROCESSING.equals(st)) {
        tsk.status_id = State.BREAKING;
        return tsk.id;
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.