Package qat.parser

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


      // 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

    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

      // 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

      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

      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

      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

        // form 2 of the allowed syntax
        command = resolveExpression(expression);
        timeout = new QASHToken("0",QASHToken.TT_NUMBER,command.line);
      }       

      AgentInstance agentInstance = (AgentInstance)qashProperties.getActiveAgent(new Integer(agentID.toString()));
      if (agentInstance==null)
        throw new Exception("Unknown agentID");      setProperty(processID.toString(),agentInstance.CMDSTART(strToArray(command.toString()), timeout.toString()));
    }
    catch (Exception e) {
      printError(CMDSTART,"Problem processing CMDSTART command ("+e.toString()+") :",currToken);
    }
  }
View Full Code Here

      processID = getToken(processIDName);

      setStatusText(QASHConstants.getTokenValue(CMDSTOP),processIDName.toString());

      AgentInstance agentInstance = getAgentRunningProcess(processID.toString());
      if (agentInstance==null)
        throw new Exception("Unknown processID");
      if (statusID!=null) {
        //form 2
        setProperty(statusID.toString(),agentInstance.CMDSTOP(processID.toString()));
      }
      else {
        // form 1
        agentInstance.CMDSTOP(processID.toString());
      }
    }
    catch (Exception e) {
      printError(CMDSTOP,"Problem processing CMDSTOP command ("+e.toString()+") :",currToken);
    }
View Full Code Here

      QASHToken processID = getToken(processIDName);
      QASHToken processStatus = resolveName(getTokensUntil(RIGHT_PARENTHESIS));

      setStatusText(QASHConstants.getTokenValue(CMDSTATUS),processIDName.toString());

      AgentInstance agentInstance = getAgentRunningProcess(processID.toString());

      if (agentInstance==null)
        throw new Exception("Unknown processID");

      String statusCode = agentInstance.CMDSTATUS(processID.toString());
      setProperty(processStatus.toString(),statusCode);

      // now print out a message if the status was timed out
      int value = Integer.parseInt(statusCode);
      if (value == qat.agent.ExecProcess.TIMEDOUT_STATE) {
View Full Code Here

TOP

Related Classes of qat.parser.AgentInstance

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.