package bandwidth.window;
import java.util.Timer;
import java.util.TimerTask;
import common.util.Event;
public class Flusher extends TimerTask
{
private WindowManagerInterface windowManager;
private Event event;
private Timer timer;
public Flusher(WindowManagerInterface window)
{
this.windowManager = window;
event = new Event();
timer = new Timer("Scheduler: bandwidth flush");
}
public void start()
{
timer.scheduleAtFixedRate(this, 0, 1000);
}
public void run()
{
windowManager.resetWindow();
event.notifyCondition();
}
public void waitFlush()
{
event.waitCondition();
}
}