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();
}
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;
}
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;
}
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;
}
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());
}
}
Aggregations