Example #1
0
 public static boolean samePath(final String p1, final String p2) {
   if (SystemConfiguration.getInstance().isOnWindows()) {
     return p1.equalsIgnoreCase(p2);
   } else {
     return p1.equals(p2);
   }
 }
Example #2
0
 private BackendData getIdeBackendData() {
   final RuntimeInfo info = getIdeRuntimeInfo();
   final BackendData result = new BackendData(runtimeInfoManager, info);
   result.setNodeName(getIdeNodeName());
   result.setDebug(false);
   result.setAutostart(true);
   result.setConsole(false);
   result.setLongName(HostnameUtils.canUseLongNames());
   if (SystemConfiguration.getInstance().isDeveloper()) {
     result.setConsole(true);
   }
   if (SystemConfiguration.getInstance().isMonitoringIdeBackend()) {
     result.setMonitored(true);
   }
   result.setInternal(true);
   return result;
 }
Example #3
0
 private ILaunch launchPeer(final BackendData data) {
   final ILaunchConfiguration launchConfig = data.asLaunchConfiguration();
   try {
     final boolean registerForDebug =
         data.getLaunch() != null || SystemConfiguration.getInstance().isDeveloper();
     return launchConfig.launch(
         ILaunchManager.RUN_MODE, new NullProgressMonitor(), false, registerForDebug);
   } catch (final CoreException e) {
     ErlLogger.error(e);
     return null;
   }
 }
Example #4
0
  private String reportRuntimeDown(final String peer) {
    final String fmt = "Backend '%s' is down";
    final String msg = String.format(fmt, peer);
    if (data.getReportErrors() && !reported) {
      final String user = System.getProperty("user.name");

      String msg1;
      if (connectOnce) {
        msg1 =
            "It is likely that your network is misconfigured or uses 'strange' host names.\n"
                + "Please check the "
                + "Window->preferences->erlang->network page for hints about that."
                + "\n\n"
                + "Also, check if you can create and connect two erlang nodes on your machine\n"
                + "using \"erl -name foo1\" and \"erl -name foo2\".";
      } else {
        msg1 =
            "If you didn't shut it down on purpose, it is an "
                + "unrecoverable error, please restart Eclipse. ";
      }

      final String bigMsg =
          msg
              + "\n\n"
              + msg1
              + "\n\n"
              + "If an error report named '"
              + user
              + "_<timestamp>.txt' has been created in your home directory,\n "
              + "please consider reporting the problem. \n"
              + (SystemConfiguration.hasFeatureEnabled("erlide.ericsson.user")
                  ? ""
                  : "http://www.assembla.com/spaces/erlide/support/tickets");
      MessageReporter.showError(bigMsg, ReporterPosition.CORNER);
      reported = true;
    }
    return msg;
  }
Example #5
0
  @Override
  @SuppressWarnings("boxing")
  public void run() {
    do {
      try {
        final int v = process.waitFor();
        final String msg = String.format("Backend '%s' terminated with exit code %d.", nodeName, v);

        String report = null;
        if (shouldCreateReport(v)) {
          ErlLogger.error(msg);
          report = createReport(v, msg);
          final String reportMsg =
              report != null
                  ? "\n\n"
                      + "An error log has been created at "
                      + report
                      + ".\nPlease report the problem so that we can fix it.\n"
                      + (SystemConfiguration.hasFeatureEnabled("erlide.ericsson.user")
                          ? ""
                          : "http://www.assembla.com/spaces/erlide/support/tickets")
                  : "";
          final String bigMsg =
              msg
                  + "\n\n"
                  + "This error is not recoverable, please restart your Eclipse instance."
                  + reportMsg;
          MessageReporter.showError(bigMsg, ReporterPosition.MODAL);
        } else {
          ErlLogger.info(msg);
        }
        // FIXME backend.setExitStatus(v);
        return;
      } catch (final InterruptedException e) {
      }
    } while (true);
  }