Search in sources :

Example 1 with IBackend

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

the class BackendFactory method createIdeBackend.

@Override
public IBackend createIdeBackend() {
    final BackendData data = getIdeBackendData();
    ErlLogger.debug("Create ide backend " + data.getRuntimeInfo().getVersion());
    final IBackend backend = createBackend(data);
    return backend;
}
Also used : BackendData(org.erlide.backend.api.BackendData) IBackend(org.erlide.backend.api.IBackend)

Example 2 with IBackend

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

the class BackendFactory method createBackend.

@Override
public synchronized IBackend createBackend(final BackendData data) {
    ErlLogger.debug("Create backend " + data.getNodeName());
    final IBackend b;
    final IOtpNodeProxy runtime = createNodeProxy(data);
    final IBackendManager backendManager = BackendCore.getBackendManager();
    b = data.isInternal() ? new Backend(data, runtime, backendManager) : new ExternalBackend(data, runtime, backendManager);
    b.initialize(data.getContext(), backendManager.getCodeBundles());
    runtime.ensureRunning();
    return b;
}
Also used : IBackend(org.erlide.backend.api.IBackend) IBackendManager(org.erlide.backend.api.IBackendManager) IBackend(org.erlide.backend.api.IBackend) IOtpNodeProxy(org.erlide.runtime.api.IOtpNodeProxy)

Example 3 with IBackend

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

the class BackendManager method getByVersion.

@Override
public IOtpRpc getByVersion(final RuntimeVersion version) {
    final RuntimeInfo info = BackendCore.getRuntimeInfoCatalog().getRuntime(version, null);
    if (info == null) {
        return null;
    }
    final Collection<IBackend> list = getAllBackends();
    for (final IBackend b : list) {
        if (b.getRuntime().getVersion().equals(version)) {
            return b.getOtpRpc();
        }
    }
    for (final IBackend b : list) {
        if (b.getRuntime().getVersion().isCompatible(version)) {
            return b.getOtpRpc();
        }
    }
    return null;
}
Also used : RuntimeInfo(org.erlide.runtime.runtimeinfo.RuntimeInfo) IBackend(org.erlide.backend.api.IBackend)

Example 4 with IBackend

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

the class BackendManager method getIdeBackend.

@SuppressWarnings("null")
@Override
public synchronized IBackend getIdeBackend() {
    if (ideBackend == null) {
        final IBackend result = factory.createIdeBackend();
        addBackend(result);
        notifyBackendChange(result, BackendEvent.ADDED, null, null);
        ideBackend = result;
    }
    return ideBackend;
}
Also used : IBackend(org.erlide.backend.api.IBackend)

Example 5 with IBackend

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

the class BackendManager method createExecutionBackend.

@Override
public IBackend createExecutionBackend(final BackendData data) {
    ErlLogger.debug("create execution backend " + data.getNodeName());
    @NonNull final IBackend b = factory.createBackend(data);
    addBackend(b);
    notifyBackendChange(b, BackendEvent.ADDED, null, null);
    return b;
}
Also used : NonNull(org.eclipse.jdt.annotation.NonNull) IBackend(org.erlide.backend.api.IBackend)

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