org.xnap.io
Class BandwidthManager

java.lang.Object
  extended by org.xnap.io.BandwidthManager
Direct Known Subclasses:
UploadBandwidthManager

public class BandwidthManager
extends java.lang.Object


Nested Class Summary
 class BandwidthManager.TickRunner
           
 
Field Summary
static long TICK_LENGTH
          The default length of a tick.
 
Constructor Summary
BandwidthManager()
           
 
Method Summary
 void addBandwidthListener()
           
 boolean allocate(BandwidthManagable transfer)
          Returns true, if bandwidth was allocated.
 void consume(int weight, boolean external)
           
 void setBandwidth(long newValue)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TICK_LENGTH

public static final long TICK_LENGTH
The default length of a tick.

See Also:
Constant Field Values
Constructor Detail

BandwidthManager

public BandwidthManager()
Method Detail

addBandwidthListener

public void addBandwidthListener()

allocate

public boolean allocate(BandwidthManagable transfer)
                 throws java.lang.InterruptedException
Returns true, if bandwidth was allocated.

Throws:
java.lang.InterruptedException

consume

public void consume(int weight,
                    boolean external)

setBandwidth

public void setBandwidth(long newValue)


Copyright © 2001-2005 XNap Team. All Rights Reserved.