Package org.apache.uima.ducc.transport.event.common

Examples of org.apache.uima.ducc.transport.event.common.ITimeWindow


       
    ProcessBuilder pb = new ProcessBuilder(cmd);
   
    if ( ((ManagedProcess)super.managedProcess).getDuccProcess().getProcessType().equals(ProcessType.Pop) ||
        ((ManagedProcess)super.managedProcess).getDuccProcess().getProcessType().equals(ProcessType.Service)   ) {
      ITimeWindow twi = new TimeWindow();
      ((ManagedProcess) managedProcess).getDuccProcess().setTimeWindowInit(twi);
      twi.setStart(millis);
      twi.setEnd(millis);

      ITimeWindow twr = new TimeWindow();
      ((ManagedProcess) managedProcess).getDuccProcess().setTimeWindowRun(twr);
      twr.setStart(millis);

    }
 
    Map<String, String> env = pb.environment();
    //  Dont enherit agent's environment
View Full Code Here


                if(reqRole.equalsIgnoreCase(SpecificationProperties.key_role_administrator)) {
                  idp.setReasonForStoppingProcess(ReasonForStoppingProcess.AdministratorInitiated.toString());
                }
              }
              long now = System.currentTimeMillis();
              ITimeWindow twi = idp.getTimeWindowInit();
              if(twi != null) {
                if(twi.getStartLong() > 0) {
                  twi.setEndLong(now);
                }
              }
              ITimeWindow twr = idp.getTimeWindowRun();
              if(twr != null) {
                if(twr.getStartLong() > 0) {
                  twr.setEndLong(now);
                }
              }
              // prepare process not active
              properties.put(JobReplyProperties.key_message, JobReplyProperties.msg_process_canceled);
              duccEvent.setProperties(properties);
View Full Code Here

  public void copyTimeInit(IDuccProcess inventoryProcess, IDuccProcess process) {
    String methodName = "copyTimeInit";
    logger.trace(methodName, null, messages.fetch("enter"));
    DuccId processId = inventoryProcess.getDuccId();
    DuccId jobId = getJobId(processId);
    ITimeWindow twInit = inventoryProcess.getTimeWindowInit();
    if(twInit != null) {
      if(!compare(twInit,process.getTimeWindowInit())) {
        process.setTimeWindowInit(twInit);
        String millis;
        String ts;
View Full Code Here

    String methodName = "copyTimeRun";
    logger.trace(methodName, null, messages.fetch("enter"));
    //validate(inventoryProcess);
    DuccId processId = inventoryProcess.getDuccId();
    DuccId jobId = getJobId(processId);
    ITimeWindow twRun = inventoryProcess.getTimeWindowRun();
    if(twRun != null) {
      if(!compare(twRun,process.getTimeWindowRun())) {
        process.setTimeWindowRun(twRun);
        String millis;
        String ts;
View Full Code Here

    }
    logger.trace(methodName, job.getDuccId(), messages.fetch("exit"));
  }
 
  private ITimeWindow makeTimeWindow(String ts) {
    ITimeWindow tw = new TimeWindow();
    tw.setStart(ts);
    tw.setEnd(ts);
    return tw;
  }
View Full Code Here

    return tw;
  }
 
  private void initStop(IDuccWorkJob job, IDuccProcess process) {
    String ts = TimeStamp.getCurrentMillis();
    ITimeWindow twi = process.getTimeWindowInit();
    if(twi == null) {
      twi = makeTimeWindow(ts);
      process.setTimeWindowInit(twi);
    }
    else {
      long i0 = twi.getStartLong();
      long i1 = twi.getEndLong();
      if(i0 != i1) {
        if(i1 < i0) {
          twi.setEnd(ts);
        }
      }
    }
  }
View Full Code Here

      }
    }
  }
 
  private void runStart(IDuccWorkJob job, IDuccProcess process) {
    ITimeWindow twi = process.getTimeWindowInit();
    ITimeWindow twr = makeTimeWindow(twi.getEnd());
    process.setTimeWindowRun(twr);
  }
View Full Code Here

    process.setTimeWindowRun(twr);
  }
 
  private void runStop(IDuccWorkJob job, IDuccProcess process) {
    String ts = TimeStamp.getCurrentMillis();
    ITimeWindow twi = process.getTimeWindowInit();
    if(twi == null) {
      twi = makeTimeWindow(ts);
      process.setTimeWindowRun(twi);
    }
    ITimeWindow twr = process.getTimeWindowRun();
    if(twr == null) {
      twr = makeTimeWindow(twi.getEnd());
      process.setTimeWindowRun(twr);
    }
    else {
      long r0 = twr.getStartLong();
      long r1 = twr.getEndLong();
      if(r0 != r1) {
        if(r1 < r0) {
          twr.setEnd(ts);
        }
      }
    }
    adjustWindows(job, process);
    adjustRunTime(process);
View Full Code Here

  }
 
  // <uima-3351>
  private void adjustRunTime(IDuccProcess process) {
    if(!process.isAssignedWork()) {
      ITimeWindow twr = process.getTimeWindowRun();
      if(twr == null) {
        twr = new TimeWindow();
        process.setTimeWindowRun(twr);
      }
      long time = 0;
      twr.setStartLong(time);
      twr.setEndLong(time);
    }
  }
View Full Code Here

  }
  // </uima-3351>
 
  private void adjustWindows(IDuccWorkJob job, IDuccProcess process) {
    String methodName = "adjustWindows";
    ITimeWindow twi = process.getTimeWindowInit();
    long i0 = twi.getStartLong();
    long i1 = twi.getEndLong();
    ITimeWindow twr = process.getTimeWindowRun();
    long r0 = twr.getStartLong();
    long r1 = twr.getEndLong();
    if(i0 != i1) {
      if(r0 != r1) {
        if(r0 < i1) {
          logger.warn(methodName, job.getDuccId(), process.getDuccId(), "run-start: "+r0+" -> "+i1);
          r0 = i1;
          twr.setStartLong(r0);
          if(r1 < r0) {
            logger.warn(methodName, job.getDuccId(), process.getDuccId(), "run-end: "+r1+" -> "+r0);
            r1 = r0;
            twr.setEndLong(r1);
          }
        }
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.uima.ducc.transport.event.common.ITimeWindow

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.