Package org.jgroups.util

Examples of org.jgroups.util.Responses.addResponse()


        long start=System.currentTimeMillis();
        new Thread() {
            public void run() {
                Util.sleep(500);
                for(int i=5; i < 10; i++)
                    rsps.addResponse(new PingData(addrs[i],true,names[i],phys_addrs[i]), false);
            }
        }.start();

        done=rsps.waitFor(20000);
        long time=System.currentTimeMillis() - start;
View Full Code Here


        long start=System.currentTimeMillis();
        new Thread() {
            public void run() {
                Util.sleep(500);
                for(int i=0; i < 2; i++)
                    rsps.addResponse(new PingData(addrs[i],true,names[i],phys_addrs[i]), false);
                rsps.addResponse(new PingData(addrs[3], true, names[3], phys_addrs[3]).coord(true), false);
            }
        }.start();

        done=rsps.waitFor(20000);
View Full Code Here

        new Thread() {
            public void run() {
                Util.sleep(500);
                for(int i=0; i < 2; i++)
                    rsps.addResponse(new PingData(addrs[i],true,names[i],phys_addrs[i]), false);
                rsps.addResponse(new PingData(addrs[3], true, names[3], phys_addrs[3]).coord(true), false);
            }
        }.start();

        done=rsps.waitFor(20000);
        long time=System.currentTimeMillis() - start;
View Full Code Here

    }

    public void testIterator() throws Exception {
        Responses rsps=new Responses(10, true);
        for(int i=0; i < 5; i++)
            rsps.addResponse(new PingData(addrs[i],true,names[i],phys_addrs[i]), false);
        int count=0;
        for(PingData data: rsps) {
            if(data != null)
                count++;
            if(count == 2)
View Full Code Here

        int count=0;
        for(PingData data: rsps) {
            if(data != null)
                count++;
            if(count == 2)
                rsps.addResponse(new PingData(addrs[5],true,names[5],phys_addrs[5]), false);
        }
        assert count == 5;
    }

    public void testIterator2() {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.