Package org.jgroups.util

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


            // Sept 2008 (bela): break if we got a belated JoinRsp (https://jira.jboss.org/jira/browse/JGRP-687)
            if(installViewIfValidJoinRsp(join_promise, false))
                return;

            responses.waitFor(gms.join_timeout);
            responses.done();
            long diff=System.currentTimeMillis() - start;
            if(responses.isEmpty()) {
                log.trace("%s: no members discovered after %d ms: creating cluster as first member", gms.local_addr, diff);
                becomeSingletonMember(mbr);
View Full Code Here


                down_prot.down(new Event(Event.MSG, discovery_req));
                return;
            }

            Responses rsps=(Responses)down_prot.down(Event.FIND_MBRS_EVT);
            rsps.waitFor(discovery_timeout); // return immediately if done
            if(rsps.isEmpty())
                return;

            log.trace("discovery protocol returned %d responses: %s", rsps.size(), rsps);
            for(PingData rsp: rsps) {
View Full Code Here

        assert !rsps.isDone();
        for(int i=0; i < 5; i++)
            rsps.addResponse(new PingData(addrs[i], true, names[i], phys_addrs[i]), false);
        System.out.println("rsps = " + rsps);
        assert !rsps.isDone();
        assert !rsps.waitFor(500);

        for(int i=0; i < 5; i++)
            assert rsps.containsResponseFrom(addrs[i]);
        assert !rsps.containsResponseFrom(addrs[5]);
View Full Code Here

        for(int i=5; i < 10; i++)
            rsps.addResponse(new PingData(addrs[i], true, names[i], phys_addrs[i]), false);
        System.out.println("rsps = " + rsps);
        assert rsps.isDone() && rsps.size() == 10;
        assert rsps.waitFor(60000);
    }

    public void testContainsResponse() {
        Responses rsps=new Responses(10, true);
        assert !rsps.isDone();
View Full Code Here

        assert rsps.isDone();
    }

    public void testWaitFor() throws Exception {
        final Responses rsps=new Responses(5, true);
        boolean done=rsps.waitFor(500);
        assert !done;
        long start=System.currentTimeMillis();
        new Thread() {
            public void run() {
                Util.sleep(500);
View Full Code Here

                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;
        System.out.printf("rsps (in %d ms) = %s\n", time, rsps);
        assert done;
        assert rsps.size() == 5;
    }
View Full Code Here

        assert rsps.size() == 5;
    }

    public void testWaitFor2() throws Exception {
        final Responses rsps=new Responses(5, true);
        boolean done=rsps.waitFor(500);
        assert !done;
        long start=System.currentTimeMillis();
        new Thread() {
            public void run() {
                Util.sleep(500);
View Full Code Here

                    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;
        System.out.printf("rsps (in %d ms) = %s\n", time, rsps);
        assert done;
        assert rsps.size() == 3;
    }
View Full Code Here

        assert rsps.size() == 3;
    }

    public void testWaitForOnDone() {
        final Responses rsps=new Responses(5, true).done();
        boolean done=rsps.waitFor(500);
        assert done;
    }

    public void testIterator() throws Exception {
        Responses rsps=new Responses(10, true);
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.