Examples of Rsp


Examples of org.jgroups.util.Rsp

        stop=System.currentTimeMillis();
        System.out.println("rsps:\n" + rsps);
        System.out.println("call took " + (stop - start) + " ms");
        assertNotNull(rsps);
        Assert.assertEquals(2, rsps.size());
        Rsp rsp=rsps.get(c1.getAddress());
        assertNotNull(rsp);
        byte[] ret=(byte[])rsp.getValue();
        Assert.assertEquals(size, ret.length);

        rsp=rsps.get(c2.getAddress());
        assertNotNull(rsp);
        ret=(byte[])rsp.getValue();
        Assert.assertEquals(size, ret.length);

        Util.close(c2);
    }
View Full Code Here

Examples of org.jgroups.util.Rsp

        responses=new Rsp[1];
        setTargets(mbrs);
    }

    void setTarget(Address mbr) {
        responses[0]=new Rsp(mbr);
        num_not_received++;
    }
View Full Code Here

Examples of org.jgroups.util.Rsp

    }

    void setTargets(Collection<Address> mbrs) {
        int index=0;
        for(Address mbr: mbrs) {
            responses[index++]=new Rsp(mbr);
            num_not_received++;
        }
    }
View Full Code Here

Examples of org.jgroups.util.Rsp

     * <code>execute()</code> returns.
     */
    public void receiveResponse(Object response_value, Address sender) {
        if(done)
            return;
        Rsp rsp=findResponse(sender);
        if(rsp == null)
            return;

        RspFilter rsp_filter=options.getRspFilter();
        boolean responseReceived=false;
        if(!rsp.wasReceived()) {
            if((responseReceived=(rsp_filter == null) || rsp_filter.isAcceptable(response_value, sender)))
                rsp.setValue(response_value);
            rsp.setReceived(responseReceived);
        }

        lock.lock();
        try {
            if(responseReceived)
View Full Code Here

Examples of org.jgroups.util.Rsp

     public void suspect(Address suspected_member) {
        if(suspected_member == null)
            return;

        boolean changed=false;
        Rsp rsp=findResponse(suspected_member);
        if(rsp !=  null) {
            if(rsp.setSuspected(true)) {
                rsp.setValue(null);
                changed=true;
                lock.lock();
                try {
                    num_suspected++;
                    completed.signalAll();
View Full Code Here

Examples of org.jgroups.util.Rsp

     (e.g. if a suspicion service is available; timeouts are not needed).
     */
    public UnicastRequest(Message m, RequestCorrelator corr, Address target, RequestOptions options) {
        super(m, corr, null, options);
        this.target=target;
        result=new Rsp(target);
    }
View Full Code Here

Examples of org.jgroups.util.Rsp

     *                       (e.g. if a suspicion service is available; timeouts are not needed).
     */
    public UnicastRequest(Message m, Transport transport, Address target, RequestOptions options) {
        super(m, null, transport, options);
        this.target=target;
        result=new Rsp(target);
    }
View Full Code Here

Examples of org.jgroups.util.Rsp

        a1=Util.createRandomAddress();
        a2=Util.createRandomAddress();
        a3=Util.createRandomAddress();
        a4=Util.createRandomAddress();
        a5=Util.createRandomAddress();
        rsp1=new Rsp(a1);
        rsp2=new Rsp(a2, true);
        rsp3=new Rsp(a3, "hello world");
        rsp4=new Rsp(a4, Boolean.TRUE);
        rsp5=new Rsp(a5, true);
        rl.put(a1, rsp1);
        rl.put(a2, rsp2);
        rl.put(a3, rsp3);
        rl.put(a4, rsp4);
        rl.put(a5, rsp5);
View Full Code Here

Examples of org.jgroups.util.Rsp

        assert rl.containsValue(rsp3);
    }


    public void testGet() {
        Rsp rsp=rl.get(a1);
        Assert.assertEquals(rsp, rsp1);
        rsp=rl.get(a3);
        Assert.assertEquals(rsp, rsp3);
    }
View Full Code Here

Examples of org.jgroups.util.Rsp

        Assert.assertEquals(rsp, rsp3);
    }


    public void testPut() {
        Rsp rsp;
        rsp=rl.put(Util.createRandomAddress(), new Rsp(Util.createRandomAddress(), true));
        assert rsp == null;
        rsp=rl.put(a2, rsp2);
        Assert.assertEquals(rsp, rsp2);
        Assert.assertEquals(6, rl.size());
    }
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.