Package org.jgroups.stack

Examples of org.jgroups.stack.RouterStub


  private void initializeRouterStubs() {  
      PhysicalAddress physical_addr=(PhysicalAddress)down_prot.down(new Event(Event.GET_PHYSICAL_ADDRESS, local_addr));
    if (gossip_hosts != null) {      
      for (InetSocketAddress host : gossip_hosts) {
        RouterStub rs = new RouterStub(host.getHostName(), host.getPort(), null, physical_addr);
        rs.setSocketConnectionTimeout(socket_conn_timeout);
        rs.setSocketReadTimeout(socket_read_timeout);
        clients.add(rs);
      }
    } else if (gossip_host != null && gossip_port != 0) {
      RouterStub rs = new RouterStub(gossip_host, gossip_port, null,physical_addr);
      rs.setSocketConnectionTimeout(socket_conn_timeout);
      rs.setSocketReadTimeout(socket_read_timeout);
      clients.add(rs);
    }
  }
View Full Code Here


                 local = adapter.local_addr;
             }
            
             stubManager = new TUNNELStubManager(this,group,local,getReconnectInterval());
             for (InetSocketAddress gr : gossip_router_hosts) {
                 RouterStub stub = stubManager.createStub(gr.getHostName(), gr.getPort(), bind_addr);
                 stub.setTcpNoDelay(tcp_nodelay);          
             
             PhysicalAddress physical_addr=(PhysicalAddress)down(new Event(Event.GET_PHYSICAL_ADDRESS, local));
             List<PhysicalAddress> physical_addrs=Arrays.asList(physical_addr);
             String logical_name=org.jgroups.util.UUID.get(local);
             List<RouterStub> stubs = stubManager.getStubs();
View Full Code Here

  private void initializeRouterStubs() {  
      PhysicalAddress physical_addr=(PhysicalAddress)down_prot.down(new Event(Event.GET_PHYSICAL_ADDRESS, local_addr));
    if (gossip_hosts != null) {      
      for (InetSocketAddress host : gossip_hosts) {
        RouterStub rs = new RouterStub(host.getHostName(), host.getPort(), null, physical_addr);
        rs.setSocketConnectionTimeout(socket_conn_timeout);
        rs.setSocketReadTimeout(socket_read_timeout);
        clients.add(rs);
      }
    } else if (gossip_host != null && gossip_port != 0) {
      RouterStub rs = new RouterStub(gossip_host, gossip_port, null,physical_addr);
      rs.setSocketConnectionTimeout(socket_conn_timeout);
      rs.setSocketReadTimeout(socket_read_timeout);
      clients.add(rs);
    }
  }
View Full Code Here

      sock = new DatagramSocket(0, bind_addr);

      super.start();

      for (InetSocketAddress gr : gossip_router_hosts) {
         RouterStub stub = new RouterStub(gr.getHostName(), gr.getPort(), bind_addr,getPhysicalAddress());
         stub.setConnectionListener(new StubConnectionListener(stub));
         stubs.add(stub);
      }
   }
View Full Code Here

    public void start() throws Exception {
        // loopback turned on is mandatory
        loopback = true;
        intentionallyTornDown = false;

        stub = new RouterStub(router_host, router_port, bind_addr);
        stub.setConnectionListener(new StubConnectionListener());
        local_addr = stub.getLocalAddress();
        if(additional_data != null && local_addr instanceof IpAddress)
            ((IpAddress) local_addr).setAdditionalData(additional_data);
        super.start();
View Full Code Here

            router_port=Integer.parseInt(str);
            props.remove("router_port");
        }

        if(router_host != null && router_port != 0)
            client=new RouterStub(router_host, router_port);

        if(props.size() > 0) {
            log.error("the following properties are not recognized: " + props);
            return false;
        }
View Full Code Here

                // if there are any stubs, destroy them
                stub.destroy();
            stubs.clear();

            for (InetSocketAddress host : initial_hosts) {
                RouterStub stub = new RouterStub(host.getHostName(), host.getPort(), null);
                stub.setConnectionListener(this);
                stubs.add(stub);
            }
            connect(group_addr, local_addr);
            startConnectionChecker();
        }
View Full Code Here

            for(RouterStub stub: stubs) // if there are any stubs, destroy them
                stub.destroy();
            stubs.clear();
           
            for (InetSocketAddress host : initial_hosts) {
                RouterStub stub=new RouterStub(host.getHostName(), host.getPort(), null);
                stub.setConnectionListener(this);
        stubs.add(stub);
      }
            connect(group_addr, local_addr);
            startConnectionChecker();
        }
View Full Code Here

                log.trace("registering " + local_addr + " under " + group_addr + " with GossipRouter");
            
            stubs.clear();
           
            for (InetSocketAddress host : initial_hosts) {
                RouterStub stub=new RouterStub(host.getHostName(), host.getPort(), null);
                stub.setConnectionListener(this);
        stubs.add(stub);
      }
            connect(group_addr, local_addr);
            startConnectionChecker();
        }
View Full Code Here

                log.trace("registering " + local_addr + " under " + group_addr + " with GossipRouter");
            
            stubs.clear();
           
            for (InetSocketAddress host : initial_hosts) {
                RouterStub stub=new RouterStub(host.getHostName(), host.getPort(), null);
                stub.setConnectionListener(this);
        stubs.add(stub);
      }
            connect(group_addr, local_addr);
            startConnectionChecker();
        }
View Full Code Here

TOP

Related Classes of org.jgroups.stack.RouterStub

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.