コード例 #1
0
ファイル: GMS.java プロジェクト: jtoerber/JGroups
 public void init() throws Exception {
   if (view_ack_collection_timeout <= 0)
     throw new IllegalArgumentException("view_ack_collection_timeout has to be greater than 0");
   if (merge_timeout <= 0)
     throw new IllegalArgumentException("merge_timeout has to be greater than 0");
   prev_members = new BoundedList<Address>(num_prev_mbrs);
   prev_views = new BoundedList<Tuple<View, Long>>(num_prev_views);
   TP transport = getTransport();
   timer = transport.getTimer();
   if (timer == null) throw new Exception("timer is null");
   if (impl != null) impl.init();
   transport.registerProbeHandler(this);
 }
コード例 #2
0
  public void start() {
    if (corr == null)
      corr =
          createRequestCorrelator(prot_adapter, this, local_addr)
              .asyncDispatching(async_dispatching);
    correlatorStarted();
    corr.start();

    if (channel != null) {
      List<Address> tmp_mbrs = channel.getView() != null ? channel.getView().getMembers() : null;
      setMembers(tmp_mbrs);
      if (channel instanceof JChannel) {
        TP transport = channel.getProtocolStack().getTransport();
        corr.registerProbeHandler(transport);
      }
      TP transport = channel.getProtocolStack().getTransport();
      hardware_multicast_supported = transport.supportsMulticasting();
      transport.registerProbeHandler(probe_handler);
    }
  }
コード例 #3
0
ファイル: JChannel.java プロジェクト: schaebo/JGroups
  protected void startStack(String cluster_name) throws Exception {
    /*make sure the channel is not closed*/
    checkClosed();

    /*make sure we have a valid channel name*/
    if (cluster_name == null) log.debug("cluster_name is null, assuming unicast channel");
    else this.cluster_name = cluster_name;

    if (socket_factory != null) prot_stack.getTopProtocol().setSocketFactory(socket_factory);

    prot_stack.startStack(
        cluster_name, local_addr); // calls start() in all protocols, from top to bottom

    /*create a temporary view, assume this channel is the only member and is the coordinator*/
    List<Address> t = new ArrayList<>(1);
    t.add(local_addr);
    my_view = new View(local_addr, 0, t); // create a dummy view

    TP transport = prot_stack.getTransport();
    transport.registerProbeHandler(probe_handler);
  }