Package com.ericsson.otp.erlang

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


    {
      OtpErlangList listOfTraces = (OtpErlangList)traces;
      for(OtpErlangObject entryObj:listOfTraces)
      {
        OtpErlangTuple entry = (OtpErlangTuple)entryObj;
        if (entry.arity() != 2)
          throw new IllegalArgumentException("invalid trace: more than a pair of pos/neg and data");
       
        boolean positive = false;
        OtpErlangAtom traceType = (OtpErlangAtom)entry.elementAt(0);
        if (traceType.atomValue().equals("pos"))
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

    if (!(obj instanceof OtpErlangTuple))
      throw new IllegalArgumentException("expected a tuple, parsed "+ obj);
    OtpErlangTuple tuple = (OtpErlangTuple) obj;

    ErlangLabel outcome = null;
    switch (tuple.arity()) {
    case 2:
      if (!(tuple.elementAt(0) instanceof OtpErlangAtom))
        throw new IllegalArgumentException(
            "function name should be an atom, got "
                + tuple.elementAt(0));
View Full Code Here

          tuple.elementAt(2), tuple.elementAt(3));
      break;
    default:
      throw new IllegalArgumentException(
          "expected Erlang label, got tuple of arity "
              + tuple.arity() + " in " + tuple);
    }

    // now assign a function name
    ErlangModule mod = ErlangModule
        .findModule(config.getErlangModuleName());
View Full Code Here

    if (!(obj instanceof OtpErlangTuple))
      throw new IllegalArgumentException("expected a tuple, parsed "+ obj);
    OtpErlangTuple tuple = (OtpErlangTuple) obj;

    ErlangLabel outcome = null;
    switch (tuple.arity()) {
    case 2:
      if (!(tuple.elementAt(0) instanceof OtpErlangAtom))
        throw new IllegalArgumentException(
            "function name should be an atom, got "
                + tuple.elementAt(0));
View Full Code Here

          tuple.elementAt(2), tuple.elementAt(3));
      break;
    default:
      throw new IllegalArgumentException(
          "expected Erlang label, got tuple of arity "
              + tuple.arity() + " in " + tuple);
    }

    // now assign a function name
    ErlangModule mod = ErlangModule
        .findModule(config.getErlangModuleName());
View Full Code Here

    }
    OtpErlangList trace = (OtpErlangList) result.elementAt(2);
    ErlangLabel[] answerDetails = new ErlangLabel[trace.arity()];
    for (int i = 0; i < trace.arity(); ++i) {
      OtpErlangTuple elemAti = (OtpErlangTuple) trace.elementAt(i);
      if (elemAti.arity() < 2 || elemAti.arity() > 3)
        throw new IllegalArgumentException("received tuple " + elemAti
            + " of invalid arity");
      if (elemAti.arity() == 3) {
        if (config.getUseErlangOutputs()) {
          answerDetails[i] = new ErlangLabel(
View Full Code Here

    }
    OtpErlangList trace = (OtpErlangList) result.elementAt(2);
    ErlangLabel[] answerDetails = new ErlangLabel[trace.arity()];
    for (int i = 0; i < trace.arity(); ++i) {
      OtpErlangTuple elemAti = (OtpErlangTuple) trace.elementAt(i);
      if (elemAti.arity() < 2 || elemAti.arity() > 3)
        throw new IllegalArgumentException("received tuple " + elemAti
            + " of invalid arity");
      if (elemAti.arity() == 3) {
        if (config.getUseErlangOutputs()) {
          answerDetails[i] = new ErlangLabel(
View Full Code Here

    for (int i = 0; i < trace.arity(); ++i) {
      OtpErlangTuple elemAti = (OtpErlangTuple) trace.elementAt(i);
      if (elemAti.arity() < 2 || elemAti.arity() > 3)
        throw new IllegalArgumentException("received tuple " + elemAti
            + " of invalid arity");
      if (elemAti.arity() == 3) {
        if (config.getUseErlangOutputs()) {
          answerDetails[i] = new ErlangLabel(
              questionDetails[i].function,
              questionDetails[i].callName,
              questionDetails[i].input, elemAti.elementAt(2));
View Full Code Here

        + "receive ok -> ok end,"
        + "Ref=make_ref(),"
        + "synapselauncher:find_statechum()!{self(),Ref,getNodeName},"
        + "receive {Ref,ok,Value} -> "
        + "{Pid,Value} end");
    Assert.assertEquals(2,pid_node.arity());
    String synapseNode = ErlangLabel.dumpErlangObject(pid_node.elementAt(1));
    OtpErlangPid pid = (OtpErlangPid)pid_node.elementAt(0);// PID of the parent process
   
    // Check that Synapse is running.
    Assert.assertTrue(pingNode(synapseNode));
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.