Examples of OtpErlangPid


Examples of com.ericsson.otp.erlang.OtpErlangPid

      Test the function OtpErlangFun.equals()
    */

    public static void main(String argv[]) {

        OtpErlangPid pid = new OtpErlangPid("here", 4, 5, 0);
        String module = "mod";
        int arity = 2;
        byte[] md5 = new byte[]{3,5,7};
        int index = 2;
        long old_index = 1;
View Full Code Here

Examples of com.ericsson.otp.erlang.OtpErlangPid

      OtpErlangObject o = mbox.receive(recTime);
      if (o == null) System.exit(1);
      OtpErlangTuple testCase = (OtpErlangTuple)o;
      dbg("mbox received " + testCase);
      int tag = (int)((OtpErlangLong)testCase.elementAt(0)).longValue();
      OtpErlangPid erlangPid = (OtpErlangPid)testCase.elementAt(1);

      switch (tag) {

      case java_erlang_send_receive:
View Full Code Here

Examples of com.ericsson.otp.erlang.OtpErlangPid

        if (arity < 2) {
      System.out
        .println("Arity < 2; echo_server aborting...");
      System.exit(2);
        } else if (arity == 2) {
      final OtpErlangPid from = (OtpErlangPid) msg
        .elementAt(0);
      if (debug) System.out.println("Echoing: "
                  + msg.elementAt(1));

      final OtpErlangObject[] rmsg = new OtpErlangObject[2];
View Full Code Here

Examples of com.ericsson.otp.erlang.OtpErlangPid

    }

    private static void echoTwisted(final OtpMbox mbox,
            final OtpErlangTuple msg)
      throws OtpErlangException {
  final OtpErlangPid from = (OtpErlangPid) msg.elementAt(0);

  final OtpErlangObject[] rmsg = new OtpErlangObject[3];
  if (debug) System.out.println("Echo in: " + msg);
  rmsg[0] = mbox.self();
  rmsg[1] = twist(msg.elementAt(1), rmsg[2] = msg.elementAt(2));
View Full Code Here

Examples of com.ericsson.otp.erlang.OtpErlangPid

   *            The calling process reference
   * @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

Examples of com.ericsson.otp.erlang.OtpErlangPid

   * @param reply
   *            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

Examples of com.ericsson.otp.erlang.OtpErlangPid

  private final OtpErlangPid myActivePid;
  private final List<ErlangProcessSnapshot> mySnapshots;

  public BreakpointReachedEvent(OtpErlangTuple breakpointReachedMessage) throws DebuggerEventFormatException {
    OtpErlangPid activePid = getPidValue(elementAt(breakpointReachedMessage, 1));
    OtpErlangList snapshots = getListValue(elementAt(breakpointReachedMessage, 2));
    if (activePid == null || snapshots == null) throw new DebuggerEventFormatException();

    myActivePid = activePid;
    mySnapshots = new ArrayList<ErlangProcessSnapshot>(snapshots.arity());
    for (OtpErlangObject snapshot : snapshots) {
      OtpErlangTuple snapshotTuple = getTupleValue(snapshot); // {Pid, Function, Status, Info, Stack}

      OtpErlangPid pid = getPidValue(elementAt(snapshotTuple, 0));
      ErlangTraceElement init = getTraceElement(getTupleValue(elementAt(snapshotTuple, 1)), null);
      String status = getAtomText(elementAt(snapshotTuple, 2));
      OtpErlangObject info = elementAt(snapshotTuple, 3);
      List<ErlangTraceElement> stack = getStack(getListValue(elementAt(snapshotTuple, 4)));
View Full Code Here

Examples of com.ericsson.otp.erlang.OtpErlangPid

  private final OtpErlangPid myRemoteCommandListener;

  public RegisterListenerEvent(OtpErlangTuple receivedMessage) throws DebuggerEventFormatException {
    OtpErlangObject remoteCommandsListenerObject = receivedMessage.elementAt(1);
    OtpErlangPid remoteCommandsListenerPid = remoteCommandsListenerObject instanceof OtpErlangPid ? (OtpErlangPid) remoteCommandsListenerObject : null;
    if (remoteCommandsListenerPid == null) throw new DebuggerEventFormatException();
    myRemoteCommandListener = remoteCommandsListenerPid;
  }
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.