Package org.jgroups.stack

Examples of org.jgroups.stack.RouterStub$ConnectionListener


    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


    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

            }
            help();
            return;
        }

        RouterStub stub=new RouterStub(host, port, null,null);
        stub.doConnect();
        List<PingData> responses=stub.getMembers(cluster_name);
        for(PingData data: responses)
            System.out.println(data);
        stub.destroy();
    }
View Full Code Here

                 local = adapter.local_addr;
             }
            
             stubManager = new TUNNELStubManager(this,group,local,getReconnectInterval());
             for (InetSocketAddress gr : gossip_router_hosts) {
                 RouterStub stub = stubManager.createAndRegisterStub(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

                 local = adapter.local_addr;
             }
            
             stubManager = new TUNNELStubManager(this,group,local,getReconnectInterval());
             for (InetSocketAddress gr : gossip_router_hosts) {
                 RouterStub stub = stubManager.createAndRegisterStub(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

        removeInitialHost(hostname, port);
       
        //now re-add it
        InetSocketAddress isa = new InetSocketAddress(hostname, port);
        initial_hosts.add(isa);
        RouterStub s = new RouterStub(isa.getHostName(), isa.getPort(),null,stubManager);       
        connect(s, group_addr, local_addr);
        stubManager.registerStub(s);
    }
View Full Code Here

    }

    @ManagedOperation
    public boolean removeInitialHost(String hostname, int port) {
        InetSocketAddress isa = new InetSocketAddress(hostname, port);       
        RouterStub unregisterStub = stubManager.unregisterStub(isa);
        if(unregisterStub != null) {
            stubManager.stopReconnecting(unregisterStub);
            unregisterStub.destroy();
        }
        return initial_hosts.remove(isa);       
    }
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

            
            stubs.clear();
           
            // init stubs
      for (InetSocketAddress host : initial_hosts) {
        stubs.add(new RouterStub(host.getHostName(), host.getPort(),null, local_addr));
      }
           
            //and connect
            for (RouterStub stub : stubs) {
          try {
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

TOP

Related Classes of org.jgroups.stack.RouterStub$ConnectionListener

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.