Search in sources :

Example 6 with BackendData

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

the class BackendLabelProvider method getText.

@Override
public String getText(final Object element) {
    final IBackend b = (IBackend) element;
    final BackendData data = b.getData();
    final RuntimeInfo info = data.getRuntimeInfo();
    final String s = info != null ? info.getName() : "<none>";
    return s + ": " + data.getNodeName();
}
Also used : BackendData(org.erlide.backend.api.BackendData) RuntimeInfo(org.erlide.runtime.runtimeinfo.RuntimeInfo) IBackend(org.erlide.backend.api.IBackend)

Example 7 with BackendData

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

the class BackendFactory method getBuildBackendData.

private BackendData getBuildBackendData(@NonNull final RuntimeInfo info) {
    final RuntimeInfo myinfo = new RuntimeInfo(info);
    final BackendData result = new BackendData(myinfo);
    result.setNodeName(info.getVersion().asMajor().toString() + "_" + BackendUtils.getErlideNodeNameTag());
    result.setCookie("erlide");
    result.setRestartable(true);
    result.setDebug(false);
    result.setManaged(true);
    result.setConsole(false);
    result.setLongName(HostnameChecker.getInstance().canUseLongNames());
    result.setInternal(true);
    result.setReportErrors(true);
    result.setContext(CodeContext.IDE);
    return result;
}
Also used : RuntimeInfo(org.erlide.runtime.runtimeinfo.RuntimeInfo) BackendData(org.erlide.backend.api.BackendData)

Example 8 with BackendData

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

the class BackendFactory method getIdeBackendData.

private BackendData getIdeBackendData() {
    final RuntimeInfo info = getIdeRuntimeInfo();
    final BackendData result = new BackendData(info);
    result.setNodeName(getIdeNodeName());
    result.setDebug(false);
    result.setConsole(SystemConfiguration.getInstance().isDeveloper());
    result.setManaged(true);
    result.setRestartable(true);
    result.setLongName(SystemConfiguration.hasFeatureEnabled("erlide.shortname") ? false : HostnameChecker.getInstance().canUseLongNames());
    result.setInternal(true);
    result.setReportErrors(true);
    result.setContext(CodeContext.IDE);
    return result;
}
Also used : RuntimeInfo(org.erlide.runtime.runtimeinfo.RuntimeInfo) BackendData(org.erlide.backend.api.BackendData)

Example 9 with BackendData

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

the class ErlangLaunchDelegate method getBackendData.

private BackendData getBackendData(final ILaunchConfiguration config, final String mode, final ILaunch launch) throws CoreException {
    if (config == null) {
        throw new IllegalArgumentException();
    }
    RuntimeInfo runtimeInfo = BackendCore.getRuntimeInfoCatalog().getRuntime(config.getAttribute(ErlRuntimeAttributes.RUNTIME_NAME, ""));
    if (runtimeInfo == null || !runtimeInfo.isValid()) {
        runtimeInfo = BackendCore.getRuntimeInfoCatalog().getDefaultRuntime();
    }
    if (runtimeInfo == null) {
        ErlLogger.error("Can't create backend without a runtime defined!");
        return null;
    }
    String defaultNodeName = getDefaultNodeNameFromProjects(config, Long.toHexString(System.currentTimeMillis() & 0xFFFFFF));
    final String nodeName = config.getAttribute(ErlRuntimeAttributes.NODE_NAME, defaultNodeName);
    final boolean managed = ErlangLaunchDelegate.shouldManageNode(nodeName, BackendCore.getEpmdWatcher());
    BackendData data = new BackendData(runtimeInfo, config, mode, managed);
    data = configureBackend(data, mode, launch);
    return data;
}
Also used : RuntimeInfo(org.erlide.runtime.runtimeinfo.RuntimeInfo) BackendData(org.erlide.backend.api.BackendData)

Example 10 with BackendData

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

the class ErlangLaunchDelegate method launch.

@Override
public void launch(final ILaunchConfiguration config, final String mode, final ILaunch launch, final IProgressMonitor monitor) throws CoreException {
    final BackendData data = getBackendData(config, mode, launch);
    if (data == null) {
        return;
    }
    if (data.isManaged()) {
        setCaptureOutput(launch);
    }
    IOtpNodeProxy runtime;
    if (!ErlangLaunchDelegate.isErlangInternalLaunch(launch)) {
        backend = BackendCore.getBackendManager().createExecutionBackend(data);
        runtime = backend.getRuntime();
    } else {
        runtime = BackendCore.getBackendManager().getFactory().createNodeProxy(data);
    }
    if (data.isManaged()) {
        startErtsProcess(launch, data, runtime.getProcess());
    }
}
Also used : BackendData(org.erlide.backend.api.BackendData) IOtpNodeProxy(org.erlide.runtime.api.IOtpNodeProxy)

Aggregations

BackendData (org.erlide.backend.api.BackendData)10 RuntimeInfo (org.erlide.runtime.runtimeinfo.RuntimeInfo)5 IBackend (org.erlide.backend.api.IBackend)3 OtpErlangString (com.ericsson.otp.erlang.OtpErlangString)1 IOtpNodeProxy (org.erlide.runtime.api.IOtpNodeProxy)1 RpcException (org.erlide.runtime.rpc.RpcException)1