Package com.ericsson.otp.erlang

Examples of com.ericsson.otp.erlang.OtpMbox.send()


            try {
                if (mbox != null) {
                    if (CHECK_RPC) {
                        ErlLogger.debug("SEND " + pid + "-> " + msg);
                    }
                    mbox.send(pid, TypeConverter.java2erlang(msg, "x"));
                }
            } finally {
                localNode.closeMbox(mbox);
            }
        } catch (final Exception e) {
View Full Code Here


            if (mbox != null) {
                if (CHECK_RPC) {
                    ErlLogger.debug("SEND " + name + "-> " + msg);
                }
                try {
                    mbox.send(name, peer, TypeConverter.java2erlang(msg, "x"));
                } catch (final SignatureException e) {
                    // ignore
                }
            }
        } finally {
View Full Code Here

        }
        //
        final OtpErlangRef ref = RpcMonitor.recordRequest(node, peer, module, fun, args,
                OtpErlang.sizeOf(res));
        //
        mbox.send("rex", peer, res);
        if (CHECK_RPC) {
            ErlLogger.debug("RPC " + mbox.hashCode() + "=> " + res);
        }
        return new RpcFuture(ref, mbox, module + ":" + fun + "/" + args0.length,
                logCalls, this);
View Full Code Here

      OtpErlangObject[] argsArray = {
          tmpMbox.self(),
          TypeHelpersProxy.toErlang(args, jmethod
              .getParameterAnnotations()) };
      OtpErlangObject otpArgs = new OtpErlangTuple(argsArray);
      tmpMbox.send(msg.getOperation().getName(), binding.getNode(),
          otpArgs);
      if (msg.getOperation().getOutputType() != null) {
        OtpMsg resultMsg = null;
        if (binding.hasTimeout()) {
          resultMsg = tmpMbox.receiveMsg(binding.getTimeout());
View Full Code Here

    // using mbox.registerName
    msgArray[0] = getNameNode("java_echo_server2",node);
    msg = new OtpErlangTuple(msgArray);

    dbg("java_echo_server2 sending " + msg);
    mbox2.send(erlangPid,msg);

    o = mbox2.receive(recTime);
    dbg("java_echo_server received " + o);
    if (o == null) System.exit(4);
    if (!((OtpErlangAtom)o).equals(msgArray[1])) System.exit(5);
View Full Code Here

      final OtpErlangObject[] amsg = new OtpErlangObject[3];
      amsg[0] = new OtpErlangAtom("echo_server");
      amsg[1] = new OtpErlangAtom(argv[0]);
      amsg[2] = mbox.self();
      final OtpErlangTuple atuple = new OtpErlangTuple(amsg);
      mbox.send(argv[3], argv[2], atuple);

      // Do echoing...
      while (true) {
    final OtpErlangObject o = mbox.receive();
    if (o == null) {
View Full Code Here

      final OtpErlangObject[] rmsg = new OtpErlangObject[2];
      rmsg[0] = mbox.self();
      rmsg[1] = msg.elementAt(1);
      final OtpErlangTuple rtuple = new OtpErlangTuple(rmsg);

      mbox.send(from, rtuple);
      continue;
        } else if (arity == 3) {
      echoTwisted(mbox, msg);
      continue;
        } else {
View Full Code Here

    OtpMbox caller = host.createMbox();
    OtpErlangTuple from = new OtpErlangTuple(new OtpErlangObject[] {
        caller.self(), host.createRef() });
    OtpErlangObject msg = new OtpErlangTuple(new OtpErlangObject[] {
        new OtpErlangAtom("$gen_call"), from, call });
    caller.send(server, msg);
    OtpErlangObject res = timeout == 0 ? caller.receive() : caller
        .receive(timeout);
    if (res == null) {
      return null;
    } else if (res instanceof OtpErlangTuple
View Full Code Here

    OtpMbox caller = host.createMbox();
    OtpErlangTuple from = new OtpErlangTuple(new OtpErlangObject[] {
        caller.self(), host.createRef() });
    OtpErlangObject msg = new OtpErlangTuple(new OtpErlangObject[] {
        new OtpErlangAtom("$gen_call"), from, call });
    caller.send(server, node, msg);
    OtpErlangObject res = timeout == 0 ? caller.receive() : caller
        .receive(timeout);
    if (res == null) {
      return null;
    } else if (res instanceof OtpErlangTuple
View Full Code Here

  public static void cast(OtpNode host, OtpErlangPid server,
      OtpErlangObject cast) {
    OtpMbox caller = host.createMbox();
    OtpErlangObject msg = new OtpErlangTuple(new OtpErlangObject[] {
        new OtpErlangAtom("$gen_cast"), cast });
    caller.send(server, msg);
  }

  /**
   * Sends an asynchronous request to the a gen_server and returns
   * immediately, ignoring if the destination node or gen_server does not
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.