Package bandwidth.window

Source Code of bandwidth.window.Flusher

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();
  }

}
TOP

Related Classes of bandwidth.window.Flusher

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.