Package qat.agent

Examples of qat.agent.ExecProcess


      String details = "Local Address : "+socket.getLocalAddress().toString()+eol+
    "Port Number : "+portNo+eol+
    "Architecture : "+System.getProperty("os.arch")+eol+
    "Operating system : "+System.getProperty("os.name")+" "+System.getProperty("os.version");
      // execute the test
      ExecProcess process = new ExecProcess(test,
              ConsoleServer.getConsoleOutput(),
              ConsoleServer.getDebugLevel(),
              showOutput,details);
      process.setDaemon(true);
      process.start();
      // add to our list of daemons
      daemonPool.add(process);
     
      // now send a signal indicating we have finished
      sendSignal(out,ProtocolConstants.RESPONSE_FINISHED_OK);
View Full Code Here


  try {
      ConsoleServer.debugMsg("Processing DAEMONCLEAN_REQUEST",1);
     
      // now send a signal indicating we are processing the request
      sendSignal(out,ProtocolConstants.RESPONSE_PROCESSING);
      ExecProcess daemon;
      while (daemonPool.size()>0) {
    ConsoleServer.debugMsg("Cleaning 1 of "+daemonPool.size()+" daemons",5);
    try {
        daemon = (ExecProcess)daemonPool.get(0);
    }
    catch (java.lang.NoSuchMethodError ex) {
        // does not exist in jdk1.1.x
        daemon = (ExecProcess)daemonPool.elementAt(0);
    }
       
    try {
        ConsoleServer.debugMsg("Interrupting daemon",5);
        daemon.interrupt();
    }
    catch (Throwable ex) {
    }
    // delete it from our list
    try {
View Full Code Here

      String details = "Local Address : "+socket.getLocalAddress().toString()+eol+
    "Port Number : "+portNo+eol+
    "Architecture : "+System.getProperty("os.arch")+eol+
    "Operating system : "+System.getProperty("os.name")+" "+System.getProperty("os.version");
      // execute the test
      ExecProcess process = new ExecProcess(test,
              ConsoleServer.getConsoleOutput(),
              ConsoleServer.getDebugLevel(),
              showOutput,details);
      try {
    processPool.add(process);
      }
      catch (java.lang.NoSuchMethodError ex) {
    // doesn't exist in jdk1.1.x
    processPool.addElement(process);
      }
      process.start();
      // now send a signal indicating we have finished
      sendSignal(out,ProtocolConstants.RESPONSE_FINISHED_OK);
  }
  catch (Exception e) {
      ConsoleServer.debugMsg("Error processing TestObject execute request:"+e.getMessage(),1);
View Full Code Here

      // read the serialized TestObject which we will stop
      test.readObject(in);
      // now send a signal indicating we are processing the request
      sendSignal(out,ProtocolConstants.RESPONSE_PROCESSING);
      // find the exit code, blocking if neccesary
      ExecProcess proc;
      boolean wasRunning = false;
      for (int i = 0; i < processPool.size(); i++) {
    try {
        proc = (ExecProcess)processPool.get(i);
    }
    catch (java.lang.NoSuchMethodError ex) {
        // does not exist in jdk1.1.x
        proc = (ExecProcess)processPool.elementAt(i);
    }
    // check for any instance of test running with the same id
    if (proc.getTestObject().getTestID().equals(test.getTestID())) {
        ConsoleServer.debugMsg("Stopping process ",5);
        wasRunning = true;
         
        // flush and close it's output streams
        proc.interrupt();
         
        // get it's status if it has finished
        status = proc.checkExitValue();
         
        sendSignal(out,status);
        break;
    }
      }
View Full Code Here

      // read the serialized TestObject that we want the exit code of
      test.readObject(in);
      // now send a signal indicating we are processing the request
      sendSignal(out,ProtocolConstants.RESPONSE_PROCESSING);
      // find the exit code, blocking if neccesary
      ExecProcess proc;
      boolean wasRunning = false;
      for (int i = 0; i < processPool.size(); i++) {
    try {
        proc = (ExecProcess)processPool.get(i);
    }
    catch (java.lang.NoSuchMethodError ex) {
        // does not exist in jdk1.1.x
        proc = (ExecProcess)processPool.elementAt(i);
    }
    // check for any instance of test running with the same name
    if (proc.getTestObject().getTestID().equals(test.getTestID())) {
        ConsoleServer.debugMsg("Returning CMDSTATUS value :"+proc.getExitValue(),5);
        out.writeInt(proc.getExitValue());
        wasRunning = true;
        // flush and close it's output streams
        proc.interrupt();
        // don't remove until it's cleaned :processPool.removeElementAt(i);
        break;
    }
      }
      if (!wasRunning) {
View Full Code Here

      // read the serialized TestObject which we want the exit code of
      test.readObject(in);
      // now send a signal indicating we are processing the request
      sendSignal(out,ProtocolConstants.RESPONSE_PROCESSING);
      // find the exit code, blocking if neccesary
      ExecProcess proc;
      boolean exists = false;
      for (int i = 0; i < processPool.size(); i++) {
    try {
        proc = (ExecProcess)processPool.get(i);
    }
    catch (java.lang.NoSuchMethodError ex) {
        // does not exist in jdk1.1.x
        proc = (ExecProcess)processPool.elementAt(i);
    }
    // check for any instance of test running with the same name
    if (proc.getTestObject().getTestID().equals(test.getTestID())) {
        try {
      ConsoleServer.debugMsg("Deleting :"+proc.getTestObject().getEnvFileName(),5)
      Utils.delete(proc.getTestObject().getEnvFileName());
        }
        catch (IOException e) {
      ConsoleServer.debugMsg("No environment file was found :"+e,1);     
        }
        try {
      ConsoleServer.debugMsg("Deleting :"+proc.getTestObject().getStdOutFileName(),5)
      Utils.delete(proc.getTestObject().getStdOutFileName());
        }
        catch (IOException e) {
      ConsoleServer.debugMsg("No stdout file was found :"+e,1);     
        }
        try {
      ConsoleServer.debugMsg("Deleting :"+proc.getTestObject().getStdErrFileName(),5)
      Utils.delete(proc.getTestObject().getStdErrFileName());
        }
        catch (IOException e) {
      ConsoleServer.debugMsg("No stderr file was found :"+e,1);     
        }           
        exists = true;
        // flush and close it's output streams by doing a STOP command
        proc.interrupt();
        try {
      processPool.remove(i);
        }
        catch (java.lang.NoSuchMethodError ex) {
      // does not exist in jdk1.1.x
View Full Code Here

      TestObject test = new TestObject();
      test.readObject(in);
      // now send a signal indicating we are processing the request
      sendSignal(out,ProtocolConstants.RESPONSE_PROCESSING);
      // find the exit code, blocking if neccesary
      ExecProcess proc;
      boolean wasRun = false;
      for (int i = 0; i < processPool.size(); i++) {
    try {
        proc = (ExecProcess)processPool.get(i);
    }
    catch (java.lang.NoSuchMethodError ex) {
        // does not exist in jdk1.1.x
        proc = (ExecProcess)processPool.elementAt(i);
    }
    // check for any instance of test running with the same name
    if (proc.getTestObject().getTestID().equals(test.getTestID())) {
        wasRun = true;
        // ---- send the env, stdout and stderr files --------------------
        sendFile(proc.getTestObject().getEnvFileName(), out);
        sendFile(proc.getTestObject().getStdOutFileName(), out);
        sendFile(proc.getTestObject().getStdErrFileName(), out);
        // ----------------------------------
        break;
    }
      }
      if (!wasRun) {
View Full Code Here

      test.readObject(in);
      // now send a signal indicating we are processing the request
      sendSignal(out,ProtocolConstants.RESPONSE_PROCESSING);
   
      // find the exit code, blocking if neccesary
      ExecProcess proc = null;
      boolean wasRun = false;
      for (int i = 0; i < processPool.size(); i++) {
    try {
        proc = (ExecProcess)processPool.get(i);
    }
    catch (java.lang.NoSuchMethodError ex) {
        // does not exist in jdk1.1.x
        proc = (ExecProcess)processPool.elementAt(i);
    }
    // check for any instance of test running with the same name
    if (proc.getTestObject().getTestID().equals(test.getTestID())) {
        wasRun = true;     
        ConsoleServer.debugMsg("Process Id was found :"+test.getTestID(),9);
        break;
    }
      }
      if (!wasRun) {
    // the process was never started, so assume it failed
    ConsoleServer.debugMsg("Process was not found :"+test.getTestID(),4);     
    sendSignal(out,ProtocolConstants.RESPONSE_FINISHED_ERROR);
      }
      else {
    ConsoleServer.debugMsg("Sending trace file paths",9);
    ConsoleServer.debugMsg("Env file :"+proc.getTestObject().getEnvFileName().toString(),9);
    ConsoleServer.debugMsg("StdOut file :"+proc.getTestObject().getStdOutFileName().toString(),9);
    ConsoleServer.debugMsg("StdErr file :"+proc.getTestObject().getStdErrFileName().toString(),9);
    // now send a signal indicating we have finished
    sendSignal(out,ProtocolConstants.RESPONSE_FINISHED_OK);
    // ---- send the env, stdout and stderr file names --------------------
    out.writeUTF(proc.getTestObject().getEnvFileName().toString());
    out.flush();
    out.writeUTF(proc.getTestObject().getStdOutFileName().toString());
    out.flush();
    out.writeUTF(proc.getTestObject().getStdErrFileName().toString())
    out.flush();
    // ----------------------------------
    sendSignal(out,ProtocolConstants.RESPONSE_FINISHED_OK);
      }
  }
View Full Code Here

  try {
      ConsoleServer.debugMsg("Processing KILLALL request",1);
      // now send a signal indicating we are processing the request
      sendSignal(out,ProtocolConstants.RESPONSE_PROCESSING);
      // kill the test
      ExecProcess proc;
      for (int i = 0; i < processPool.size(); i++) {
    try {
        proc = (ExecProcess)processPool.get(i);
    }
    catch (java.lang.NoSuchMethodError ex) {
        // does not exist in jdk1.1.x
        proc = (ExecProcess)processPool.elementAt(i);
    }
    proc.interrupt();
      }
      processPool.clear();
      // now send a signal indicating we have finished
      sendSignal(out,ProtocolConstants.RESPONSE_FINISHED_OK);
  }
View Full Code Here

TOP

Related Classes of qat.agent.ExecProcess

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.