com.aelitis.azureus.core.networkmanager.impl
Class EntityHandler

java.lang.Object
  extended by com.aelitis.azureus.core.networkmanager.impl.EntityHandler

public class EntityHandler
extends Object

Manages transfer entities on behalf of peer connections. Each entity handler has a global pool which manages all connections by default. Connections can also be "upgraded" to a higher connection control level, i.e. each connection has its own specialized entity for performance purposes.


Constructor Summary
EntityHandler(int type, RateHandler rate_handler)
          Create a new entity handler using the given rate handler.
 
Method Summary
 void cancelPeerConnection(NetworkConnectionBase connection)
          Remove a peer connection from the entity handler.
 void downgradePeerConnection(NetworkConnectionBase connection)
          Downgrade (return) a peer connection back into the general pool.
 RateHandler getRateHandler(NetworkConnectionBase connection)
           
 void registerPeerConnection(NetworkConnectionBase connection)
          Register a peer connection for management by the handler.
 void upgradePeerConnection(NetworkConnectionBase connection, RateHandler handler, int partition_id)
          Upgrade a peer connection from the general pool to its own high-speed entity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntityHandler

public EntityHandler(int type,
                     RateHandler rate_handler)
Create a new entity handler using the given rate handler.

Parameters:
type - read or write type handler
rate_handler - global max rate handler
Method Detail

registerPeerConnection

public void registerPeerConnection(NetworkConnectionBase connection)
Register a peer connection for management by the handler.

Parameters:
connection - to add to the global pool

cancelPeerConnection

public void cancelPeerConnection(NetworkConnectionBase connection)
Remove a peer connection from the entity handler.

Parameters:
connection - to cancel

upgradePeerConnection

public void upgradePeerConnection(NetworkConnectionBase connection,
                                  RateHandler handler,
                                  int partition_id)
Upgrade a peer connection from the general pool to its own high-speed entity.

Parameters:
connection - to upgrade from global management
handler - individual connection rate handler

downgradePeerConnection

public void downgradePeerConnection(NetworkConnectionBase connection)
Downgrade (return) a peer connection back into the general pool.

Parameters:
connection - to downgrade back into the global entity

getRateHandler

public RateHandler getRateHandler(NetworkConnectionBase connection)