package org.jgroups.tests; import org.jgroups.Message; import org.jgroups.util.Util; import org.jgroups.stack.AckReceiverWindow; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; import java.util.concurrent.locks.Condition; /** * @author Bela Ban * @version $Id$ */ public class bla { public static void main(String[] args) throws Exception { AckReceiverWindow win=new AckReceiverWindow(1); for(int i=1; i <=5; i++) { win.add(i, msg()); win.remove(); } MyThread thread=new MyThread(win); thread.start(); win.add2(6, msg(), 6000); thread.join(); System.out.println("win = " + win); } private static class MyThread extends Thread { private final AckReceiverWindow win; public MyThread(AckReceiverWindow win) { this.win=win; } public void run() { Util.sleep(5000); for(int i=1; i <= 10; i++) { win.add(i, msg()); win.remove(); } } } private static Message msg() { return new Message(); } }