Package org.jgroups.stack

Examples of org.jgroups.stack.RouterStub


        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

    }

    public void setUp() throws Exception {
        super.setUp();
        routerPort=Utilities.startGossipRouter("127.0.0.1");
        stub=new RouterStub("127.0.0.1", routerPort);
    }
View Full Code Here

    public void test_CONNECT_Route_To_All() throws Exception {
        log.info("running test_CONNECT_Route_To_All");
        Message msg, msgCopy;

        stub2=new RouterStub("127.0.0.1", routerPort);


        stub.connect(groupName)// register the first member
        Address addr=stub.getLocalAddress();
View Full Code Here

        Message msg, msgCopy;

        stub.connect(groupName);
        Address localAddrOne=stub.getLocalAddress();

        stub2=new RouterStub("127.0.0.1", routerPort);

        stub2.connect(groupName);
        Address localAddrTwo=stub2.getLocalAddress();
        String payload="THIS IS A MESSAGE PAYLOAD " + random.nextLong();
View Full Code Here


        stub.connect(groupName);
        final Address localAddrOne=stub.getLocalAddress();

        stub2=new RouterStub("127.0.0.1", routerPort);
        stub2.connect(groupName);

        // send a series of stress routing requests to all members
        final int count=20000; // total number of messages to be sent
        int timeout=50; // nr of secs to wait for all messages to arrive
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

    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

        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,cluster_name, local_addr);
        stubManager.registerStub(s);
    }
View Full Code Here

    }

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