Example #1
0
  /**
   * Activates several cluster services. Used by backups on failover.
   *
   * @throws Exception
   */
  public synchronized void activate() throws Exception {
    if (state != State.STARTED && state != State.DEPLOYED) return;

    if (backup) {
      backup = false;

      deployConfiguredBridges();

      for (BroadcastGroup broadcastGroup : broadcastGroups.values()) {
        try {
          broadcastGroup.start();
        } catch (Exception e) {
          HornetQServerLogger.LOGGER.unableToStartBroadcastGroup(e, broadcastGroup.getName());
        }
      }

      for (ClusterConnection clusterConnection : clusterConnections.values()) {
        try {
          clusterConnection.activate();
        } catch (Exception e) {
          HornetQServerLogger.LOGGER.unableToStartClusterConnection(e, clusterConnection.getName());
        }
      }

      for (Bridge bridge : bridges.values()) {
        try {
          bridge.start();
        } catch (Exception e) {
          HornetQServerLogger.LOGGER.unableToStartBridge(e, bridge.getName());
        }
      }
    }
  }
Example #2
0
  public synchronized void start() throws Exception {
    if (state == State.STARTED) {
      return;
    }

    for (BroadcastGroup group : broadcastGroups.values()) {
      if (!backup) {
        group.start();
      }
    }

    for (ClusterConnection conn : clusterConnections.values()) {
      conn.start();
      if (backup && configuration.isSharedStore()) {
        conn.informTopology();
        conn.announceBackup();
      }
    }

    deployConfiguredBridges();
    state = State.STARTED;
  }