Package com.ericsson.otp.erlang

Examples of com.ericsson.otp.erlang.OtpErlangTuple.arity()


            {
              //System.out.println("worker terminated");
              break;
            }
            else
              if (command.equals(msgUpdateConfiguration) && message.arity() == 3)
              {
                String outcome = ErlangRunner.updateConfiguration(learnerInitConfiguration.config, message.elementAt(2));
                if (outcome == null)
                  mbox.send(erlangPartner,new OtpErlangTuple(new OtpErlangObject[]{ref,msgOk}));
                else
View Full Code Here


                  mbox.send(erlangPartner,new OtpErlangTuple(new OtpErlangObject[]{ref,msgOk}));
                else
                  mbox.send(erlangPartner,new OtpErlangTuple(new OtpErlangObject[]{ref,msgFailure,new OtpErlangList(outcome)}));// report an error.
              }
              else
                if (command.equals(msgLine) && message.arity() == 3)
                {
                  process(message.elementAt(2).toString());
                }
                else
                  if (command.equals(msgTraces) && message.arity() == 3)
View Full Code Here

                if (command.equals(msgLine) && message.arity() == 3)
                {
                  process(message.elementAt(2).toString());
                }
                else
                  if (command.equals(msgTraces) && message.arity() == 3)
                  {
                    OtpErlangObject outcome = new OtpErlangTuple(new OtpErlangObject[]{ref,msgOk});
                    try
                    {
                      parseTraces(message.elementAt(2));
View Full Code Here

      // success, but null response
    }
    else if (response instanceof OtpErlangTuple) {
      OtpErlangTuple decodedResponse = (OtpErlangTuple) response;
      if (decodedResponse.arity() == 0)
        throw new IllegalArgumentException(errorMessage  + " : unexpectedly short response (arity " + decodedResponse.arity() + ") " + response);
      OtpErlangObject decodedResponseCode = decodedResponse.elementAt(0);
      if (!(decodedResponseCode instanceof OtpErlangAtom))
        throw new IllegalArgumentException(errorMessage  + " : unexpected type in response tuple " + decodedResponse);
      if (!decodedResponseCode.equals(okAtom))
View Full Code Here

      // success, but null response
    }
    else if (response instanceof OtpErlangTuple) {
      OtpErlangTuple decodedResponse = (OtpErlangTuple) response;
      if (decodedResponse.arity() == 0)
        throw new IllegalArgumentException(errorMessage  + " : unexpectedly short response (arity " + decodedResponse.arity() + ") " + response);
      OtpErlangObject decodedResponseCode = decodedResponse.elementAt(0);
      if (!(decodedResponseCode instanceof OtpErlangAtom))
        throw new IllegalArgumentException(errorMessage  + " : unexpected type in response tuple " + decodedResponse);
      if (!decodedResponseCode.equals(okAtom))
      {
View Full Code Here

  public OtpErlangList listProcesses()
  {
    OtpErlangList outcome = null;
    OtpErlangTuple tup = call(new OtpErlangObject[] { new OtpErlangAtom(
        "processes") }, "Failed to get process list.");
    if (tup != null && (tup.arity() == 2) && (tup.elementAt(0).equals(okAtom))) {
      outcome = (OtpErlangList) tup.elementAt(1);
    } else
      if (tup == null)
        throw new IllegalArgumentException("NULL response from call to get process list");
      else
View Full Code Here

    } else
      if (tup == null)
        throw new IllegalArgumentException("NULL response from call to get process list");
      else
        throw new IllegalArgumentException("Unexpected response from a call to get a process list: "
          + tup.elementAt(0) + "(" + tup.arity() + ")");
   
    return outcome;
  }

  public OtpErlangTuple killProcesses(OtpErlangList proclist)
View Full Code Here

    Assert.assertEquals(1, analysisResults.arity());
    OtpErlangTuple fileDetails = (OtpErlangTuple) analysisResults.elementAt(0);
    OtpErlangList typeInformation = (OtpErlangList) fileDetails.elementAt(3);
    for (int i = 0; i < typeInformation.arity(); ++i) {
      OtpErlangTuple functionDescr = (OtpErlangTuple) typeInformation.elementAt(i);
      if (functionDescr.arity() > 3)
      {
        FuncSignature s = new FuncSignature(config,functionDescr, null);
        sigTypes.put(s.getQualifiedName(), functionDescr);
        //sigs.put(s.getQualifiedName(), s);
      }
View Full Code Here

  {
    sigTypes.putAll(updatesToTypes);sigs.clear();
    for(Entry<String,OtpErlangTuple> entry:sigTypes.entrySet())
    {
      OtpErlangTuple functionDescr = entry.getValue();
      if (functionDescr.arity() > 3)
      {
        FuncSignature s = new FuncSignature(config,functionDescr, null);
        if (!s.getQualifiedName().equals(entry.getKey()))
          throw new IllegalArgumentException("invalid override, expected name "+entry.getKey()+", got "+s.getQualifiedName());
        sigs.put(entry.getKey(), s);
View Full Code Here

      try {
        OtpErlangObject msg=thisMbox.receive();
        if (!(msg instanceof OtpErlangTuple))
          System.out.println("invalid message received, expected tuple, got "+msg);
        OtpErlangTuple message = (OtpErlangTuple)msg;
        if (message.arity() != 3)
          System.out.println("invalid tuple received, expected three elements, got "+msg);
       
        if (!(message.elementAt(2) instanceof OtpErlangAtom))
          System.out.println("invalid request received, expected an atom, got "+message.elementAt(2));
        OtpErlangAtom command = (OtpErlangAtom) message.elementAt(2);
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.