Package org.erlide.runtime.api

Examples of org.erlide.runtime.api.IOtpRpc


        public void dispose() {
        }

        @Override
        public Object[] getElements(final Object parent) {
            final IOtpRpc backend = getBackend().getOtpRpc();
            if (backend == null) {
                return new OtpErlangObject[] {};
            }

            final OtpErlangList r = ErlangEngine.getInstance().getProclistService()
View Full Code Here


     *
     * @return list of processes
     */
    public static TracedProcess[] getProcsOnTracedNodes() {
        try {
            final IOtpRpc backend = TraceBackend.getInstance().getBackend(true)
                    .getOtpRpc();
            final List<OtpErlangAtom> nodeAtoms = new ArrayList<OtpErlangAtom>();

            for (final Object o : TraceBackend.getInstance().getTracedNodesArray()) {
                final TracedNode tracedNode = (TracedNode) o;
                if (tracedNode.isEnabled()) {
                    nodeAtoms.add(new OtpErlangAtom(tracedNode.getNodeName()));
                }
            }

            final OtpErlangList nodesList = new OtpErlangList(
                    nodeAtoms.toArray(new OtpErlangAtom[nodeAtoms.size()]));
            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);
View Full Code Here

                ((MatchSpec) getValue()).setMsObject(new OtpErlangAtom("x"));
                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);
View Full Code Here

            // already done
            return true;
        }
        final IErlProject project = ErlangEngine.getInstance().getModelUtilService()
                .getProject(this);
        final IOtpRpc backend = OtpRpcFactory.getOtpRpcForProject(project);
        if (backend != null) {
            final List<String> files = ErlangEngine.getInstance()
                    .getService(OpenService.class).getLibFiles(entry);
            final List<IErlModule> children = Lists
                    .newArrayListWithCapacity(files.size());
View Full Code Here

                final IErlProject project = ErlangEngine.getInstance()
                        .getModelUtilService().getProject(editor.getModule());
                if (project == null) {
                    return;
                }
                final IOtpRpc backend = BackendCore.getBuildBackend(project);

                final String stateDir = ErlideUIPlugin.getDefault().getStateLocation()
                        .toString();
                final OtpErlangTuple otpDoc = (OtpErlangTuple) ErlangEngine.getInstance()
                        .getService(OtpDocService.class)
View Full Code Here

        String anchor = "";
        try {
            if (erlProject == null) {
                return null;
            }
            final IOtpRpc backend = BackendCore.getBuildBackend(erlProject);
            if (backend == null) {
                return null;
            }

            final IErlModel model = ErlangEngine.getInstance().getModel();
View Full Code Here

        List<ExternalTreeEntry> externalIncludeTree = cache
                .getExternalTree(externalIncludes);
        if (externalModuleTree == null || externalIncludeTree == null) {
            final OtpErlangList pathVars = ErlangEngine.getInstance().getModel()
                    .getPathVars(project.getWorkspaceProject());
            final IOtpRpc backend = OtpRpcFactory.getOtpRpcForProject(project);
            if (externalModuleTree == null && externalModules.length() > 0) {
                if (pm != null) {
                    pm.worked(1);
                }
                externalModuleTree = ErlangEngine.getInstance()
View Full Code Here

    @Override
    public boolean buildStructure(final IProgressMonitor pm) throws ErlModelException {
        final IErlProject erlProject = ErlangEngine.getInstance().getModelUtilService()
                .getProject(this);
        final IOtpRpc backend = OtpRpcFactory.getOtpRpcForProject(erlProject);
        if (backend != null) {
            addExternalEntries(pm, backend);
        }
        return true;
    }
View Full Code Here

                            .getAlternatePLTFileDirectoryFromPreferences();
                    checkIfPltFilesShouldBeCopied(alternatePltFileDirectory);
                    final IErlProject eproject = ErlangEngine.getInstance().getModel()
                            .findProject(project);
                    if (eproject != null) {
                        final IOtpRpc backend = BackendCore.getBuildBackend(eproject);
                        for (final String pltPath : selectedPLTPaths) {
                            checkPlt(pltPath, alternatePltFileDirectory, monitor, backend);
                        }
                    }
                } catch (final Exception e) {
View Full Code Here

        } catch (final IllegalThreadStateException e) {
            val = -1;
        }
        assertThat("bad exit value", val, is(-1));
        assertThat("not running", nodeProxy.isRunning(), is(true));
        final IOtpRpc site = nodeProxy.getOtpRpc();
        OtpErlangObject r;
        try {
            r = site.call("erlang", "now", "");
        } catch (final RpcException e) {
            r = null;
        }
        assertThat("rpc", r, is(not(nullValue())));
        try {
            site.cast("erlang", "halt", "i", 0);
        } catch (final RpcException e1) {
        }
        expect(nodeProxy, process, 0, State.TERMINATED);
    }
View Full Code Here

TOP

Related Classes of org.erlide.runtime.api.IOtpRpc

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.