Package com.ericsson.otp.erlang

Examples of com.ericsson.otp.erlang.OtpErlangObject


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

    try {
      OtpErlangObject reply = conn.receiveRPC();

      return new SymbolicBeamFileData(check((ETuple)OtpConverter.convert(reply), file));

    } catch (OtpErlangExit e) {
      throw new RuntimeException("external beam_loader died", e);
View Full Code Here


        new OtpErlangObject[] {
              new OtpErlangAtom("disasm"),
              new OtpErlangBinary(data) }));

    try {
      OtpErlangObject reply = conn.receiveRPC();

      return new SymbolicBeamFileData(check((ETuple)OtpConverter.convert(reply), data));

    } catch (OtpErlangExit e) {
      throw new RuntimeException("external beam_loader died", e);
View Full Code Here

        try {
            final Bindings b = OtpErlang.match(
                    "{Payload, Encoding, Leader, From, Tstamp}", obj);
            encoding = getEncoding(b.getAtom("Encoding"));

            final OtpErlangObject o = b.get("Payload");
            if (o instanceof OtpErlangString) {
                message = ((OtpErlangString) o).stringValue();
            } else if (o instanceof OtpErlangList) {
                final OtpErlangList l = (OtpErlangList) o;
                if (l.arity() == 0) {
                    message = "";
                } else {
                    try {
                        message = l.stringValue();
                    } catch (final Exception e) {
                        message = o.toString();
                    }
                }
            } else {
                message = o.toString();
            }
            message = convertEncoding(message, encoding);

            leader = b.getPid("Leader");
            final OtpErlangObject s = b.get("From");
            if (s instanceof OtpErlangPid) {
                sender = (OtpErlangPid) s;
            } else {
                sender = new OtpErlangPid("s", 0, 0, 0);
            }
View Full Code Here

                }

                final OtpErlangPid pid = (OtpErlangPid) ((OtpErlangTuple) obj)
                        .elementAt(0);

                final OtpErlangObject r = ErlangEngine.getInstance().getProclistService()
                        .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++) {
View Full Code Here

            receiveEventMessage(eventBox);
        } while (!stopped);
    }

    private void receiveEventMessage(final OtpMbox eventBox) throws OtpErlangExit {
        OtpErlangObject msg = null;
        try {
            msg = eventBox.receive(POLL_INTERVAL);
            final ErlEvent busEvent = eventHelper.parse(msg, this);
            if (busEvent != null) {
                if (DEBUG) {
View Full Code Here

        return ok;
    }

    private boolean waitForCodeServer() {
        try {
            OtpErlangObject r;
            int i = 30;
            boolean gotIt = false;
            do {
                r = otpRpc.call("erlang", "whereis", "a", "code_server");
                gotIt = !(r instanceof OtpErlangPid);
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

    }

    @Test
    public void testToTerm_1() {
        final BooleanOption option = CompilerOption.WARN_EXPORT_ALL;
        final OtpErlangObject actual = option.toTerm(true);
        final String expected = "warn_export_all";
        Assert.assertEquals(expected, actual.toString());
    }
View Full Code Here

    }

    @Test
    public void testToTerm_2() {
        final BooleanOption option = CompilerOption.WARN_EXPORT_ALL;
        final OtpErlangObject actual = option.toTerm(false);
        final String expected = "nowarn_export_all";
        Assert.assertEquals(expected, actual.toString());
    }
View Full Code Here

    }

    @Test
    public void testToTerm_3() {
        final BooleanOption option = CompilerOption.DEBUG_INFO;
        final OtpErlangObject actual = option.toTerm(true);
        final String expected = "debug_info";
        Assert.assertEquals(expected, actual.toString());
    }
View Full Code Here

TOP

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

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.