Examples of AgentInstance


Examples of qat.parser.AgentInstance

        StringBuffer processid = resolveVariable(processidname);
        processidname = QAXMLExpression.removeVariableBraces(processidname);
        processidname = resolveVariable(processidname);
        setStatusText(traceNode.getNodeName()+" "+processidname.toString());
        printStream.println(traceNode.getNodeName()+" "+processidname.toString());
        AgentInstance agentInstance = getAgentRunningProcess(processid);

        if (agentInstance==null)
          throw new Exception("unknown processid "+processid);
        agentInstance.CMDGETTRACE(processid.toString(),
            projectResultsDir+File.separator+
            Common.getUniqueTestIdentifier(testPath)+"_"+processidname.toString());
        addToPropertiesList(INTERNAL_TRACE_LIST,processidname.toString());
      }
      else {
View Full Code Here

Examples of qat.parser.AgentInstance

    try {
      org.w3c.dom.NamedNodeMap attributes = cleanNode.getAttributes();
      if (onlyIf(attributes)) {
        StringBuffer processidname = getAttribute(attributes, "processid");
        StringBuffer processid = resolveVariable(processidname);    processidname = QAXMLExpression.removeVariableBraces(processidname);    setStatusText(cleanNode.getNodeName()+" "+resolveVariable(processidname).toString());
        printStream.println(cleanNode.getNodeName()+" "+resolveVariable(processidname).toString());    AgentInstance agentInstance = getAgentRunningProcess(processid);

        if (agentInstance==null)
          throw new Exception("Unknown processID :"+processid.toString());
        agentInstance.CMDCLEAN(processid.toString());
        properties.remove(processidname.toString());
      }
      else {
        printStream.println("trace cancelled (onlyif false)");
      }
View Full Code Here

Examples of qat.parser.AgentInstance

   * Looks through currently running agents for an identifier matching processID.
   * Returns the matching AgentInstance, or null if it wasn't found.
   */
  private AgentInstance getAgentRunningProcess(StringBuffer processid) {
    try {
      AgentInstance agentInstance;
      for (Iterator<String> e = agentMap.keySet().iterator() ; e.hasNext() ;) {
        agentInstance = (AgentInstance)agentMap.get(e.next());
        if (agentInstance.isHandlingProcess(processid.toString())) {
          return agentInstance;
        }
      }
    }
    catch(Exception e) {
View Full Code Here

Examples of qat.parser.AgentInstance

  public void interrupt() {
    interrupted = true;
    // now call kill for all active agents
    if (!inEvaluationMode()) {
      AgentInstance agent=null;
      for (Enumeration<AgentInstance> agentList = qashProperties.getActiveAgents() ; agentList.hasMoreElements() ;) {
        try {
          agent = (AgentInstance)agentList.nextElement();
          agent.KILLSTARTEDPROCESSES();
        }
        catch (Exception e) {
          printError(3,"Error killing one or more agent processes - recommend restarting agents manually!"+" :"+e.toString());
        }
      }
View Full Code Here

Examples of qat.parser.AgentInstance

      // check that this agentID is unused
      if (getToken(agentID)!=null) {
        throw new Exception("Identifier already exists :"+agentName.toString());
      }
      int uniqueID = Utils.getUniqueID();
      AgentInstance agentInstance =  new AgentInstance(agentName.toString(),
          new Integer(agentPort.toString()).intValue(),
          agentWorkDir.toString(),
          inEvaluationMode());
      qashProperties.addActiveAgent(new Integer(uniqueID),agentInstance);
      // set the agentID property to reflect the agent ID which was allocated
View Full Code Here

Examples of qat.parser.AgentInstance

    try {
      expectLeftParenthesis();
      QASHToken agentIDName = resolveName(getTokensUntil(RIGHT_PARENTHESIS));
      QASHToken agentID = resolveExpression(agentIDName);      setStatusText(QASHConstants.getTokenValue(DELAGENT),agentIDName.toString());

      AgentInstance agentInstance = (AgentInstance)qashProperties.removeActiveAgent(new Integer(agentID.toString())); // remove also returns the object it deleted
      if (agentInstance==null)
        throw new Exception("Unknown agentID");
      try {
        agentInstance.DELAGENT();
      }
      catch (Exception ex) {
        printError(DELAGENT,"Error cleaning up agent ("+ex.toString()+") :",currToken);
      }
      finally {
View Full Code Here

Examples of qat.parser.AgentInstance

      // check that this zip id is unused
      if (getToken(zipID)!=null) {
        throw new Exception("ZIP Identifier already exists :"+zipID.toString()+SET_OPERATOR+getToken(zipID).toString());
      }
      AgentInstance agentInstance = (AgentInstance)qashProperties.getActiveAgent(new Integer(agentID.toString()));
      if (agentInstance==null)
        throw new Exception("Unknown agentID");
      // send the zip file, and retrieve the associated zip ID
      try {
        setProperty(zipID.toString(),agentInstance.ZIPSEND(zipFile.toString()));
      }
      catch (Exception ex) {
        printError(ZIPSEND,"Problem sending zip file to agent ("+ex.toString()+") :",currToken);
      }
    }
View Full Code Here

Examples of qat.parser.AgentInstance

      QASHToken zipIDVar = resolveName(zipIDVariable);
      QASHToken zipID = resolveExpression(zipIDVar);

      setStatusText(QASHConstants.getTokenValue(ZIPCLEAN),zipIDVar.toString());

      AgentInstance agentInstance = getAgentForZip(zipID.toString());
      if (agentInstance==null)
        throw new Exception("Unknown zipID "+zipIDVar);
      agentInstance.ZIPCLEAN(zipID.toString());
      removeProperty(zipIDVar.toString());
    }
    catch (Exception e) {
      printError(ZIPCLEAN,"Problem processing ZIPCLEAN command ("+e.toString()+") :",currToken);
    }
View Full Code Here

Examples of qat.parser.AgentInstance

      else {
        // form 2 of the allowed syntax
        key = resolveName(expression);
        value = resolveExpression(key);
      }     
      AgentInstance agentInstance = (AgentInstance)qashProperties.getActiveAgent(new Integer(agentID.toString()));
      if (agentInstance==null)
        throw new Exception("Unknown agentID");
      agentInstance.SETPROP(key.toString(),value.toString());
    }
    catch (Exception e) {
      printError(SETPROP,"Problem processing SETPROP command ("+e.toString()+") :",currToken);
    }
  } 
View Full Code Here

Examples of qat.parser.AgentInstance

      expectLeftParenthesis();
      QASHToken agentIDName = resolveName(getTokensUntil(COMMA));
      QASHToken key = resolveExpression(getTokensUntil(RIGHT_PARENTHESIS));
      QASHToken agentID = resolveExpression(agentIDName);

      AgentInstance agentInstance = (AgentInstance)qashProperties.getActiveAgent(new Integer(agentID.toString()));
      if (agentInstance==null)
        throw new Exception("Unknown agentID");
      agentInstance.DELPROP(key.toString(),null);
    }
    catch (Exception e) {
      printError(DELPROP,"Problem processing DELPROP command ("+e.toString()+") :",currToken);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.