Exemplo n.º 1
0
  @Override
  protected void init() {
    super.init();

    if (process.isTerminated()) {
      if (shellConnection != null) {
        try {
          shellConnection.disconnect();
        } catch (final IOException e) {
          KarafUIPluginActivator.getLogger().error("Unable to disconnect from SSH server", e);
        }
      }
    } else {
      DebugPlugin.getDefault().addDebugEventListener(this);
    }
  }
Exemplo n.º 2
0
  @Override
  public void handleDebugEvents(final DebugEvent[] events) {
    for (final DebugEvent event : events) {
      if (event.getSource().equals(process)) {
        if (event.getKind() == DebugEvent.TERMINATE) {
          if (shellConnection != null) {
            try {
              shellConnection.disconnect();
            } catch (final IOException e) {
              KarafUIPluginActivator.getLogger().error("Unable to disconnect from SSH server", e);
            }
          }
          DebugPlugin.getDefault().removeDebugEventListener(this);

          resetName();
        }
      }
    }
  }