Package com.ericsson.otp.erlang

Examples of com.ericsson.otp.erlang.OtpErlangTuple


  }
 
  @Override
  public BeamFileData load(File file) throws IOException {

    sendGEN(conn, "beam_loader", new OtpErlangTuple(
        new OtpErlangObject[] {
              new OtpErlangAtom("disasm"),
              new OtpErlangString(file.getAbsolutePath()) }));

    try {
View Full Code Here


  }

  @Override
  public BeamFileData load(byte[] data) throws IOException {

    sendGEN(conn, "beam_loader", new OtpErlangTuple(
        new OtpErlangObject[] {
              new OtpErlangAtom("disasm"),
              new OtpErlangBinary(data) }));

    try {
View Full Code Here

    reply[0] = self.pid();
    reply[1] = self.createRef();
   
    gen[0] = new OtpErlangAtom("$gen_call");
    gen[1] = new OtpErlangTuple(reply);
    gen[2] = request;

    conn.send(server, new OtpErlangTuple(gen));
  }
View Full Code Here

                        .getProcessInfo(getBackend().getOtpRpc(), pid);
                if (r instanceof OtpErlangList) {
                    final OtpErlangList l = (OtpErlangList) r;
                    final StringBuilder s = new StringBuilder();
                    for (int i = 0; i < l.arity(); i++) {
                        final OtpErlangTuple e = (OtpErlangTuple) l.elementAt(i);
                        s.append(' ').append(e.elementAt(0).toString()).append("\t= ")
                                .append(e.elementAt(1).toString()).append('\n');
                    }
                    showMessage(s.toString());
                } else {
                    showMessage("Process " + pid.toString()
                            + " is probably dead.\nPlease refresh process list.");
View Full Code Here

                return new OtpErlangObject[] {};
            }
            final OtpErlangObject[] ss = new OtpErlangObject[r.elements().length];

            for (int i = 0; i < r.elements().length; i++) {
                final OtpErlangTuple e = (OtpErlangTuple) r.elementAt(i);
                ss[i] = e;
            }

            return ss;
        }
View Full Code Here

    static class ViewLabelProvider extends LabelProvider implements ITableLabelProvider {

        @Override
        public String getColumnText(final Object obj, final int index) {
            final OtpErlangTuple t = (OtpErlangTuple) obj;
            final OtpErlangObject e = t.elementAt(index + 1);
            if (e instanceof OtpErlangString) {
                return ((OtpErlangString) e).stringValue();
            }
            return e.toString();
        }
View Full Code Here

            return error;
        }
        Bindings b;
        try {
            if (arequest instanceof OtpErlangTuple) {
                final OtpErlangTuple request = (OtpErlangTuple) arequest;
                final String tag = ((OtpErlangAtom) request.elementAt(0)).atomValue();
                if ("put_chars".equals(tag)) {
                    b = OtpErlang.match("{put_chars, Chars}", request);
                    if (b != null) {
                        return callback.putChars(from, IOEncoding.latin1, b.get("Chars"));
                    }
View Full Code Here

            final OtpErlangList procList = (OtpErlangList) backend.call(MODULE_NAME,
                    FUNCTION_NAME, "x", nodesList);
            final TracedProcess[] processes = new TracedProcess[procList.arity()];

            for (int i = 0; i < procList.arity(); i++) {
                final OtpErlangTuple tuple = (OtpErlangTuple) procList.elementAt(i);
                processes[i] = new TracedProcess(tuple);
            }
            return processes;
        } catch (final RpcException e) {
            ErlLogger.error(e);
View Full Code Here

                return null;
            }
            try {

                final IOtpRpc backend = getBackend();
                final OtpErlangTuple tuple = (OtpErlangTuple) backend.call(
                        Constants.ERLANG_HELPER_MODULE, Constants.FUN_STR2MS, "s",
                        new OtpErlangString(newText));
                if (((OtpErlangAtom) tuple.elementAt(0)).atomValue().equals("ok")) {
                    // correct match spec - update
                    ((MatchSpec) getValue()).setFunctionString(newText);
                    ((MatchSpec) getValue()).setMsObject(tuple.elementAt(1));
                    return null;
                }
                // incorrect match spec
                final OtpErlangAtom errorType = (OtpErlangAtom) tuple.elementAt(1);
                if (errorType.atomValue().equals("standard_info")) {
                    final OtpErlangTuple errorTuple = (OtpErlangTuple) tuple.elementAt(2);
                    final StringBuilder builder = new StringBuilder("Line ");
                    builder.append(errorTuple.elementAt(0)).append(": ");
                    final OtpErlangList errorList = (OtpErlangList) errorTuple
                            .elementAt(2);
                    builder.append(((OtpErlangString) errorList.elementAt(0))
                            .stringValue());
                    if (errorList.elementAt(1) instanceof OtpErlangString) {
                        builder.append(((OtpErlangString) errorList.elementAt(1))
View Full Code Here

     * @return error reason or <code>null</code> or if it is not an error
     *         message
     */
    public OtpErlangObject getErrorReson(final OtpErlangObject message) {
        if (message instanceof OtpErlangTuple) {
            final OtpErlangTuple tuple = (OtpErlangTuple) message;
            if (tuple.elementAt(0) instanceof OtpErlangAtom) {
                final OtpErlangAtom atom = (OtpErlangAtom) tuple.elementAt(0);
                if (atom.atomValue().equals(ATOM_ERROR_LOADING)) {
                    return tuple.elementAt(1);
                }
            }
        }
        return null;
    }
View Full Code Here

TOP

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

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.