Package com.ericsson.otp.erlang

Examples of com.ericsson.otp.erlang.OtpErlangObject$Hash


    private void setFunctionTracePatterns() {
        for (final TracePattern tracePattern : tracePatterns) {
            if (tracePattern.isEnabled()) {
                final String function = tracePattern.isLocal() ? FUN_TPL : FUN_TP;
                try {
                    OtpErlangObject matchSpec = null;
                    if (tracePattern.getMatchSpec().getMsObject() != null) {
                        matchSpec = tracePattern.getMatchSpec().getMsObject();
                    } else {
                        matchSpec = new OtpErlangList();
                    }
View Full Code Here


        @Subscribe
        public void handleEvent(final ErlEvent event) {
            if (!event.getTopic().equals(getTopic())) {
                return;
            }
            final OtpErlangObject message = event.getEvent();
            if (message != null) {
                OtpErlangObject errorReason = null;
                // System.out.println("data: " + data);
                if (dataHandler.isTracingFinished(message)) {
                    finishLoading(firstTrace ? TracingStatus.EMPTY : TracingStatus.OK);
                } else if ((errorReason = dataHandler.getErrorReson(message)) != null) {
                    errorObject = errorReason;
View Full Code Here

            final Bindings b = OtpErlang.match("{event,Topic,Event,Sender}", msg);
            if (b == null) {
                return null;
            }
            final String topic = b.getAtom("Topic");
            final OtpErlangObject event = b.get("Event");
            final OtpErlangPid sender = b.getPid("Sender");
            return new ErlEvent(topic, nodeProxy, event, sender);
        } catch (final TermParserException e) {
            return null;
        } catch (final OtpErlangException e) {
View Full Code Here

    @Override
    public void run() {
        boolean done = false;
        do {
            OtpErlangObject msg;
            try {
                msg = mbox.receive(3000);
                if (msg != null) {

                    ErlLogger.debug("IOS " + Thread.currentThread().getName() + " : "
View Full Code Here

    private void handleMessage(final OtpErlangObject msg) {
        final OtpErlangTuple tuple = (OtpErlangTuple) msg;
        final String tag = ((OtpErlangAtom) tuple.elementAt(0)).atomValue();
        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

                    }
                } else if ("requests".equals(tag)) {
                    b = OtpErlang.match("{requests, Reqs:lx}", request);
                    if (b != null) {
                        final Collection<OtpErlangObject> reqs = b.getList("Reqs");
                        OtpErlangObject val = null;
                        for (final OtpErlangObject r : reqs) {
                            val = processRequest(from, r);
                            if (val.equals(error)) {
                                return error;
                            }
                        }
                        return val == null ? error : val;
                    }
View Full Code Here

        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) {
View Full Code Here

    @Subscribe
    public void handleEvent(final ErlEvent event) {
        if (!event.getTopic().equals(getTopic())) {
            return;
        }
        final OtpErlangObject data = event.getEvent();
        try {
            final Bindings b = OtpErlang.match("{K:a,M}", data);
            final String kind = ((OtpErlangAtom) b.get("K")).atomValue();
            final OtpErlangObject amsg = b.get("M");
            ErlLogger.debug("%s: %s", kind, OtpErlang.asString(amsg));
        } catch (final Exception e) {
            ErlLogger.error("erroneous log msg: %s", data);
        }
    }
View Full Code Here

        public void dump(final PrintStream out, final boolean full) {
            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(
                    "%30s|%25s:%-20s/%d in=%9d, out=%9d, t=%6d, args=%s -> result=%s%n",
View Full Code Here

        }
        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

TOP

Related Classes of com.ericsson.otp.erlang.OtpErlangObject$Hash

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.