Package com.ericsson.otp.erlang

Examples of com.ericsson.otp.erlang.OtpErlangRef


        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);
        if (!(message.elementAt(1) instanceof OtpErlangRef))
          System.out.println("invalid request received, expected a ref, got "+message.elementAt(1));
        OtpErlangRef ref = (OtpErlangRef) message.elementAt(1);
        if (!(message.elementAt(0) instanceof OtpErlangPid))
          System.out.println("invalid request received, expected a pid, got "+message.elementAt(0));
        OtpErlangPid pid = (OtpErlangPid) message.elementAt(0);
       
        if (command.equals(msgEcho))
View Full Code Here


 
  @Test
  public void testToStringFail1()
  {
    checkForCorrectException(new whatToRun() { public @Override void run() {
      ErlangLabel.dumpErlangObject(new OtpErlangRef("aa",1,2));
    }},IllegalArgumentException.class,"OtpErlangRef is not supported");
  }
View Full Code Here

 
  @Test
  public void testToStringFail1()
  {
    checkForCorrectException(new whatToRun() { public @Override void run() {
      ErlangLabel.dumpErlangObject(new OtpErlangRef("aa",1,2));
    }},IllegalArgumentException.class,"OtpErlangRef is not supported");
  }
View Full Code Here

            if (!(message.elementAt(1) instanceof OtpErlangAtom))
              System.out.println("invalid request received by worker, expected an atom, got "+message.elementAt(1));
            OtpErlangAtom command = (OtpErlangAtom) message.elementAt(1);
            if (!(message.elementAt(0) instanceof OtpErlangRef))
              System.out.println("invalid request received by worker, expected a ref, got "+message.elementAt(0));
            final OtpErlangRef ref = (OtpErlangRef) message.elementAt(0);

            if (command.equals(msgEcho))
              mbox.send(erlangPartner,new OtpErlangTuple(new OtpErlangObject[]{ref,msgWorkerOk}));
            if (command.equals(msgStop))
              mbox.send(erlangPartner,new OtpErlangTuple(new OtpErlangObject[]{ref,msgWorkerOk}));
View Full Code Here

        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);
        if (!(message.elementAt(1) instanceof OtpErlangRef))
          System.out.println("invalid request received, expected a ref, got "+message.elementAt(1));
        OtpErlangRef ref = (OtpErlangRef) message.elementAt(1);
        if (!(message.elementAt(0) instanceof OtpErlangPid))
          System.out.println("invalid request received, expected a pid, got "+message.elementAt(0));
        OtpErlangPid pid = (OtpErlangPid) message.elementAt(0);
       
        if (command.equals(msgEcho))
View Full Code Here

  }

  private void handleRpc(OtpMsg msg) {
    OtpErlangTuple request = null;
    OtpErlangPid senderPid = null;
    OtpErlangRef senderRef = null;
    try {
      OtpErlangTuple call = (OtpErlangTuple) msg.getMsg();
      OtpErlangTuple from = (OtpErlangTuple) call.elementAt(1);
      request = (OtpErlangTuple) call.elementAt(2);
      senderPid = (OtpErlangPid) from.elementAt(0);
View Full Code Here

   * @param reply
   *            Response to send
   */
  protected void reply(OtpErlangTuple from, OtpErlangObject reply) {
    OtpErlangPid to = (OtpErlangPid) from.elementAt(0);
    OtpErlangRef tag = (OtpErlangRef) from.elementAt(1);
    OtpErlangTuple tuple = new OtpErlangTuple((new OtpErlangObject[] { tag,
        reply }));
    getMbox().send(to, tuple);
  };
View Full Code Here

   *            The response to be sent
   */
  public static void reply(OtpNode host, OtpErlangTuple from,
      OtpErlangObject reply) {
    OtpErlangPid to = (OtpErlangPid) from.elementAt(0);
    OtpErlangRef tag = (OtpErlangRef) from.elementAt(1);
    OtpErlangTuple tuple = new OtpErlangTuple((new OtpErlangObject[] { tag,
        reply }));
    host.createMbox().send(to, tuple);
  }
View Full Code Here

TOP

Related Classes of com.ericsson.otp.erlang.OtpErlangRef

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.