コード例 #1
0
ファイル: Dock.java プロジェクト: ludup/hypersocket-client
  @Override
  public void bridgeEstablished() {
    /* Only rebuild launchers if the updater is not waiting for the bridge to come back,
     * as the GUI will be restarted shortly */
    if (updateScene == null
        || (!updateScene.isAwaitingBridgeEstablish() && !updateScene.isAwaitingGUIRestart())) {

      log.info(String.format("Bridge established, rebuilding all launchers"));
      rebuildAllLaunchers();
      if (context.getBridge().isServiceUpdating()) {
        setMode(Mode.UPDATE);
      } else {
        final StringProperty prop = Configuration.getDefault().temporaryOnStartConnectionProperty();
        String tmp = prop.get();
        if (!StringUtils.isBlank(tmp)) {
          try {
            Connection c =
                context.getBridge().getConnectionService().getConnection(Long.parseLong(tmp));
            if (c == null) throw new Exception("No connection with id of " + tmp);
            log.info(
                String.format(
                    "Using temporary 'on start' connection %d (%s)", c.getId(), c.getHostname()));
            context.getBridge().connect(c);
          } catch (Exception e) {
            log.error("Failed to start temporary 'on start' connection.", e);
          }
          prop.set("");
        }
      }
    }
  }
コード例 #2
0
ファイル: Dock.java プロジェクト: ludup/hypersocket-client
 @Override
 public void disconnected(Connection connection, Exception e) {
   log.info(String.format("Connection disconnected (%s)", connection.toString()));
   rebuildAllLaunchers();
 }
コード例 #3
0
ファイル: Dock.java プロジェクト: ludup/hypersocket-client
 @Override
 public void finishedConnecting(Connection connection, Exception e) {
   log.info(String.format("New connection finished connected (%s)", connection.toString()));
   Platform.runLater(() -> setAvailable());
 }