示例#1
0
  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);
  }