Search in sources :

Example 21 with IBackend

use of org.erlide.backend.api.IBackend in project erlide_eclipse by erlang.

the class BackendManager method dispose.

@Override
public void dispose() {
    synchronized (this) {
        final Collection<IBackend> bb = Lists.newArrayList(buildBackends.values());
        buildBackends.clear();
        for (final IBackend b : bb) {
            b.dispose();
        }
        if (ideBackend != null) {
            ideBackend.dispose();
            ideBackend = null;
        }
        final ILaunch[] launches = DebugPlugin.getDefault().getLaunchManager().getLaunches();
        launchListener.launchesTerminated(launches);
        launchListener.dispose();
    }
}
Also used : IBackend(org.erlide.backend.api.IBackend) ILaunch(org.eclipse.debug.core.ILaunch)

Example 22 with IBackend

use of org.erlide.backend.api.IBackend in project erlide_eclipse by erlang.

the class BackendManager method addExecutionBackend.

@Override
public synchronized void addExecutionBackend(final IProject project, final IBackend b) {
    final Set<IBackend> list = executionBackends.computeIfAbsent(project, k -> Sets.newHashSet());
    list.add(b);
    final IErlModel model = ErlangEngine.getInstance().getModel();
    b.addProjectPath(model.findProject(project));
}
Also used : IErlModel(org.erlide.engine.model.root.IErlModel) IBackend(org.erlide.backend.api.IBackend)

Example 23 with IBackend

use of org.erlide.backend.api.IBackend in project erlide_eclipse by erlang.

the class BackendManager method removeExecutionBackend.

@Override
public synchronized void removeExecutionBackend(final IProject project, final IProjectCodeLoader b) {
    final IErlModel model = ErlangEngine.getInstance().getModel();
    b.removeProjectPath(model.findProject(project));
    final Set<IBackend> list = executionBackends.computeIfAbsent(project, k -> Sets.newHashSet());
    list.remove(b);
}
Also used : IErlModel(org.erlide.engine.model.root.IErlModel) IBackend(org.erlide.backend.api.IBackend)

Example 24 with IBackend

use of org.erlide.backend.api.IBackend in project erlide_eclipse by erlang.

the class OtpRpcProvider method get.

@Override
public IOtpRpc get() {
    try {
        final IBackendManager backendManager = BackendCore.getBackendManager();
        final IBackend ideBackend = backendManager.getIdeBackend();
        return ideBackend.getOtpRpc();
    } catch (final Exception e) {
        ErlLogger.error("No Erlang runtime is installed! (" + e.getMessage() + ")");
        return null;
    }
}
Also used : IBackendManager(org.erlide.backend.api.IBackendManager) IBackend(org.erlide.backend.api.IBackend)

Example 25 with IBackend

use of org.erlide.backend.api.IBackend in project erlide_eclipse by erlang.

the class ErlangLineBreakpoint method createRequest.

private void createRequest(final int request) {
    final IBackend b = target.getBackend();
    int line = -1;
    try {
        line = getLineNumber();
    } catch (final CoreException e) {
        ErlLogger.warn(e);
    }
    final IResource r = getMarker().getResource();
    final String module = r.getLocation().toPortableString();
    if (line != -1) {
        ErlideDebug.addDeleteLineBreakpoint(b, module, line, request);
    }
}
Also used : CoreException(org.eclipse.core.runtime.CoreException) IBackend(org.erlide.backend.api.IBackend) LineBreakpoint(org.eclipse.debug.core.model.LineBreakpoint) IResource(org.eclipse.core.resources.IResource)

Aggregations

IBackend (org.erlide.backend.api.IBackend)25 IBackendManager (org.erlide.backend.api.IBackendManager)6 CoreException (org.eclipse.core.runtime.CoreException)4 IErlProject (org.erlide.engine.model.root.IErlProject)4 RuntimeInfo (org.erlide.runtime.runtimeinfo.RuntimeInfo)4 BackendData (org.erlide.backend.api.BackendData)3 ErlModelException (org.erlide.engine.model.ErlModelException)3 IErlModel (org.erlide.engine.model.root.IErlModel)3 HashSet (java.util.HashSet)2 IProject (org.eclipse.core.resources.IProject)2 IResource (org.eclipse.core.resources.IResource)2 OperationCanceledException (org.eclipse.core.runtime.OperationCanceledException)2 ILaunch (org.eclipse.debug.core.ILaunch)2 BackendException (org.erlide.backend.api.BackendException)2 RpcException (org.erlide.runtime.rpc.RpcException)2 OtpErlangBinary (com.ericsson.otp.erlang.OtpErlangBinary)1 OtpErlangList (com.ericsson.otp.erlang.OtpErlangList)1 OtpErlangObject (com.ericsson.otp.erlang.OtpErlangObject)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 ArrayList (java.util.ArrayList)1