Package org.jgroups.stack

Examples of org.jgroups.stack.AckMcastSenderWindow$Task


                }
                break;

            case Event.CONNECT_OK:
                passUp(evt);
                sender_win=new AckMcastSenderWindow(this, timeout);

                // send join announcement
                Message join_msg=new Message();
                join_msg.putHeader(name, new SmackHeader(SmackHeader.JOIN_ANNOUNCEMENT, -1));
                passDown(new Event(Event.MSG, join_msg));
View Full Code Here


    _win.stop();
    } // testAck()


    public void testRemove() throws UnknownHostException {
        AckMcastSenderWindow mywin=new AckMcastSenderWindow(new MyCommand(), new long[]{1000,2000,3000});
        Address sender1=new IpAddress("127.0.0.1", 10000);
        Address sender2=new IpAddress("127.0.0.1", 10001);
        Address sender3=new IpAddress("127.0.0.1", 10002);
        Vector  senders=new Vector();
        Message msg=new Message();
        long    seqno=322649;

        senders.addElement(sender1);
        senders.addElement(sender2);
        senders.addElement(sender3);

        mywin.add(seqno, msg, (Vector)senders.clone()); // clone() for the fun of it...

        mywin.ack(seqno, sender1);
        mywin.ack(seqno, sender2);

        System.out.println("entry is " + mywin.printDetails(seqno));
        assertTrue(mywin.getNumberOfResponsesExpected(seqno) == 3);
        assertTrue(mywin.getNumberOfResponsesReceived(seqno) == 2);
        mywin.waitUntilAllAcksReceived(4000);
        mywin.suspect(sender3);
        assertTrue(mywin.size() == 0); // because suspect() removed that entry
    }
View Full Code Here

    public AckMcastSenderWindowTest(String name) { super(name); }


    public void setUp() {
    _cmd = new Cmd();
    _win = new AckMcastSenderWindow(_cmd);
    _tbl = new Hashtable();
    }
View Full Code Here

                sender_win.stop();
                break;

            case Event.CONNECT:
                Object ret=down_prot.down(evt);
                sender_win=new AckMcastSenderWindow(this, new StaticInterval(timeout));

                // send join announcement
                Message join_msg=new Message();
                join_msg.putHeader(name, new SmackHeader(SmackHeader.JOIN_ANNOUNCEMENT, -1));
                down_prot.down(new Event(Event.MSG, join_msg));
View Full Code Here

                sender_win.stop();
                break;

            case Event.CONNECT:
                Object ret=down_prot.down(evt);
                sender_win=new AckMcastSenderWindow(this, new StaticInterval(timeout));

                // send join announcement
                Message join_msg=new Message();
                join_msg.putHeader(name, new SmackHeader(SmackHeader.JOIN_ANNOUNCEMENT, -1));
                down_prot.down(new Event(Event.MSG, join_msg));
View Full Code Here

                sender_win.stop();
                break;

            case Event.CONNECT:
                Object ret=down_prot.down(evt);
                sender_win=new AckMcastSenderWindow(this, new StaticInterval(timeout));

                // send join announcement
                Message join_msg=new Message();
                join_msg.putHeader(name, new SmackHeader(SmackHeader.JOIN_ANNOUNCEMENT, -1));
                down_prot.down(new Event(Event.MSG, join_msg));
View Full Code Here

        _win.stop();
    } // testAck()


    public void testRemove() throws UnknownHostException {
        AckMcastSenderWindow mywin=new AckMcastSenderWindow(new MyCommand(), new StaticInterval(1000, 2000, 3000));
        Address sender1=new IpAddress("127.0.0.1", 10000);
        Address sender2=new IpAddress("127.0.0.1", 10001);
        Address sender3=new IpAddress("127.0.0.1", 10002);
        Vector senders=new Vector();
        Message msg=new Message();
        long seqno=322649;

        senders.addElement(sender1);
        senders.addElement(sender2);
        senders.addElement(sender3);

        mywin.add(seqno, msg, (Vector)senders.clone()); // clone() for the fun of it...

        mywin.ack(seqno, sender1);
        mywin.ack(seqno, sender2);

        System.out.println("entry is " + mywin.printDetails(seqno));
        assertEquals(3, mywin.getNumberOfResponsesExpected(seqno));
        assertEquals(2, mywin.getNumberOfResponsesReceived(seqno));
        mywin.waitUntilAllAcksReceived(4000);
        mywin.suspect(sender3);
        assertEquals(0, mywin.size()); // because suspect() removed that entry
    }
View Full Code Here


    public void setUp() throws Exception {
        super.setUp();
        _cmd=new Cmd();
        _win=new AckMcastSenderWindow(_cmd);

    }
View Full Code Here

                sender_win.stop();
                break;

            case Event.CONNECT:
                Object ret=down_prot.down(evt);
                sender_win=new AckMcastSenderWindow(this, new StaticInterval(timeout));

                // send join announcement
                Message join_msg=new Message();
                join_msg.putHeader(this.id, new SmackHeader(SmackHeader.JOIN_ANNOUNCEMENT, -1));
                down_prot.down(new Event(Event.MSG, join_msg));
View Full Code Here

                sender_win.stop();
                break;

            case Event.CONNECT:
                Object ret=down_prot.down(evt);
                sender_win=new AckMcastSenderWindow(this, new StaticInterval(timeout));

                // send join announcement
                Message join_msg=new Message();
                join_msg.putHeader(name, new SmackHeader(SmackHeader.JOIN_ANNOUNCEMENT, -1));
                down_prot.down(new Event(Event.MSG, join_msg));
View Full Code Here

TOP

Related Classes of org.jgroups.stack.AckMcastSenderWindow$Task

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.