Examples of OtpErlangAtom


Examples of com.ericsson.otp.erlang.OtpErlangAtom

                        // list of nodes being traced
                        final List<OtpErlangObject> erlangObjects = new ArrayList<OtpErlangObject>();
                        notActivatedNodes = new HashSet<String>();
                        for (final TracedNode tracedNode : tracedNodes) {
                            if (tracedNode.isEnabled()) {
                                final OtpErlangAtom name = new OtpErlangAtom(
                                        tracedNode.getNodeName());
                                final OtpErlangAtom cookie = new OtpErlangAtom(
                                        tracedNode.getCookie());

                                erlangObjects.add(new OtpErlangTuple(
                                        new OtpErlangObject[] { name, cookie }));
                                notActivatedNodes.add(tracedNode.getNodeName());
View Full Code Here

Examples of com.ericsson.otp.erlang.OtpErlangAtom

        if ("io_request".equals(tag)) {
            final OtpErlangPid from = (OtpErlangPid) tuple.elementAt(1);
            final OtpErlangObject replyAs = tuple.elementAt(2);
            final OtpErlangTuple request = (OtpErlangTuple) tuple.elementAt(3);
            final OtpErlangObject reply = processRequest(from, request);
            final OtpErlangTuple replyMsg = OtpErlang.mkTuple(new OtpErlangAtom(
                    "io_reply"), replyAs, reply);
            mbox.send(from, replyMsg);
        } else {
            ErlLogger.warn("IOServer: unknown message " + msg);
        }
View Full Code Here

Examples of com.ericsson.otp.erlang.OtpErlangAtom

                    if (b != null) {
                        final Collection<OtpErlangObject> opts = b.getList("Opts");
                        return callback.setOpts(opts);
                    }
                } else if ("get_geometry".equals(tag)) {
                    return OtpErlang.mkTuple(new OtpErlangAtom("error"),
                            new OtpErlangAtom("enotsup"));
                } else {
                    return error;
                }
            } else if (arequest instanceof OtpErlangAtom) {
                final OtpErlangAtom tag = (OtpErlangAtom) arequest;
                if ("getopts".equals(tag.atomValue())) {
                    return callback.getOpts();
                }
                return error;
            } else {
                return error;
View Full Code Here

Examples of com.ericsson.otp.erlang.OtpErlangAtom

        // XXX JC copy paste
        final OtpErlangTuple tuple = getTuple();
        final OtpErlangList erlStackFrames = (OtpErlangList) tuple.elementAt(2);
        final OtpErlangTuple t2 = (OtpErlangTuple) tuple.elementAt(1);
        final OtpErlangTuple ieval = (OtpErlangTuple) t2.elementAt(0);
        OtpErlangAtom m = (OtpErlangAtom) ieval.elementAt(3);
        OtpErlangList bindings = (OtpErlangList) t2.elementAt(t2.arity() - 1);
        OtpErlangLong l = (OtpErlangLong) ieval.elementAt(1);
        final List<IStackFrame> stackFrames = new ArrayList<IStackFrame>(
                erlStackFrames.arity() + 1);
        for (final OtpErlangObject o : erlStackFrames) {
            final OtpErlangTuple t = (OtpErlangTuple) o;
            final OtpErlangTuple ml = (OtpErlangTuple) t.elementAt(1);
            final OtpErlangObject ml0 = ml.elementAt(0);
            int stackFrameNo;
            final OtpErlangLong n = (OtpErlangLong) t.elementAt(3);
            try {
                stackFrameNo = n.intValue();
            } catch (final OtpErlangRangeException e) {
                stackFrameNo = -1;
            }
            final String module = m.atomValue();
            int line;
            try {
                line = l.intValue();
            } catch (final OtpErlangRangeException e) {
                line = -1;
View Full Code Here

Examples of com.ericsson.otp.erlang.OtpErlangAtom

            Collection<OtpErlangObject> myArgs = args.get();
            myArgs = myArgs == null ? new ArrayList<OtpErlangObject>() : myArgs;
            final String argsString = full ? args.toString().replaceAll("\n|\r", " ")
                    : "...";
            OtpErlangObject val = result.get();
            val = val == null ? new OtpErlangAtom("null") : val;
            String resultString = full ? val.toString().replaceAll("\n|\r", " ") : "...";
            if (resultString.length() > 100) {
                resultString = new String(resultString.substring(0, 99) + "...");
            }
            out.format(
View Full Code Here

Examples of com.ericsson.otp.erlang.OtpErlangAtom

    public void handleEvent(final ErlEvent event) {
        if (!event.getTopic().equals(getTopic())) {
            return;
        }
        final OtpErlangTuple t = (OtpErlangTuple) event.getEvent();
        final OtpErlangAtom module = (OtpErlangAtom) t.elementAt(0);
        final OtpErlangLong line = (OtpErlangLong) t.elementAt(1);
        final OtpErlangAtom level = (OtpErlangAtom) t.elementAt(2);
        final OtpErlangObject logEvent = t.elementAt(3);
        String ss = "";
        if (t.arity() == 5) {
            final OtpErlangTuple backtrace_0 = (OtpErlangTuple) t.elementAt(4);
            final OtpErlangBinary backtrace = (OtpErlangBinary) backtrace_0.elementAt(1);
            ss = new String(backtrace.binaryValue());
        }
        try {
            ErlLogger.getInstance().erlangLog(module.atomValue() + ".erl",
                    line.uIntValue(), level.atomValue().toUpperCase(), "%s %s",
                    logEvent.toString(), ss);
        } catch (final Exception e) {
            ErlLogger.warn(e);
        }
    }
View Full Code Here

Examples of com.ericsson.otp.erlang.OtpErlangAtom

        return "RPC:" + fOk + "=" + fValue.toString();
    }

    public static RpcResult error(final String msg) {
        final RpcResult r = new RpcResult(false);
        r.fValue = OtpErlang.mkTuple(new OtpErlangAtom("error"), new OtpErlangAtom(msg));
        return r;
    }
View Full Code Here

Examples of com.ericsson.otp.erlang.OtpErlangAtom

            final OtpErlangList loaded = (OtpErlangList) backend.call("code",
                    "all_loaded", "");
            final List<OtpErlangAtom> mine = new ArrayList<OtpErlangAtom>();
            for (final OtpErlangObject elem : loaded) {
                final OtpErlangTuple t = (OtpErlangTuple) elem;
                final OtpErlangAtom mod = (OtpErlangAtom) t.elementAt(0);
                if (mod.atomValue().startsWith("erlide_")) {
                    // ErlLogger.debug(">>> HAD " + mod + "   " +
                    // t.elementAt(1));
                    mine.add(mod);
                }
            }
View Full Code Here

Examples of com.ericsson.otp.erlang.OtpErlangAtom

        attachFunctionComments(module);
        String cached = "reparsed";
        if (res != null && res.arity() > 2) {
            final OtpErlangObject res2 = res.elementAt(2);
            if (res2 instanceof OtpErlangAtom) {
                final OtpErlangAtom atom = (OtpErlangAtom) res2;
                cached = atom.atomValue();
            }
        }
        if (TRACE) {
            ErlLogger.debug("Parsed %d forms and %d comments (%s)",
                    forms != null ? forms.arity() : 0,
View Full Code Here

Examples of com.ericsson.otp.erlang.OtpErlangAtom

     * @param el
     *            the tuple, either function or attribute
     * @return
     */
    private IErlMember create(final IErlModule module, final OtpErlangTuple el) {
        final OtpErlangAtom type = (OtpErlangAtom) el.elementAt(0);
        final String typeS = type.atomValue();
        if ("error".equals(typeS)) {
            final OtpErlangTuple er = (OtpErlangTuple) el.elementAt(1);
            final String msg = helper.formatError(er);
            final ErlParserProblem e = ErlParserProblem.newError(module, msg);
            setPos(e, er.elementAt(0));
            return e;
        } else if ("tree".equals(typeS)) {
            final OtpErlangTuple atr = (OtpErlangTuple) el.elementAt(3);
            final OtpErlangObject pos = ((OtpErlangTuple) el.elementAt(2)).elementAt(1);
            final OtpErlangTuple name = (OtpErlangTuple) atr.elementAt(1);
            final OtpErlangAtom n = (OtpErlangAtom) concreteTerm(name);
            final OtpErlangObject val = atr.elementAt(2);
            final OtpErlangObject extra = el.arity() > 4 ? el.elementAt(4) : null;
            return addAttribute(module, pos, n, val, extra, null);
        } else if ("attribute".equals(typeS)) {
            final OtpErlangObject pos = el.elementAt(1);
            final OtpErlangAtom name = (OtpErlangAtom) el.elementAt(2);
            final OtpErlangObject val = el.elementAt(3);
            final OtpErlangObject extra = el.arity() > 4 ? el.elementAt(4) : null;
            final OtpErlangObject arity = el.arity() > 5 ? el.elementAt(5) : null;
            return addAttribute(module, pos, name, val, extra, arity);
        } else if ("function".equals(typeS)) {
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.