ucr.core
Class OutgoingConnectionManager

java.lang.Object
  extended byjava.lang.Thread
      extended byucr.core.ConnectionManager
          extended byucr.core.OutgoingConnectionManager
All Implemented Interfaces:
java.lang.Runnable

class OutgoingConnectionManager
extends ConnectionManager

Manages the outgoing connections, attempts to connect to the network agressively. Initiates more than required connections in an attempt to quickly achieve connections


Field Summary
protected  ConnectionData connectionData
           
protected  ConnectionList connectionList
           
private  long drop_check_waiting
           
private  HostCache hostCache
           
private static IncomingConnectionManager incomingConnectionMgr
           
protected  Router router
           
protected  boolean shutdown
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
(package private) OutgoingConnectionManager(IncomingConnectionManager incomingConnectionMgr, Router router, HostCache hostCache, ConnectionList connectionList, ConnectionData connectionData)
          Constructs the outgoing connection manager
 
Method Summary
(package private)  ConnectionList getConnectionList()
          Gets the list of connections
(package private)  int getDesiredConnectionCount()
          Get the desired connection count
(package private)  boolean isShutdown()
          Check if the manager is shut down
 void run()
           
(package private)  void setDesiredConnectionCount(int count)
          Set the desired connection count
(package private)  void shutdown()
          Closes all connections and stops processing
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

hostCache

private HostCache hostCache

incomingConnectionMgr

private static IncomingConnectionManager incomingConnectionMgr

drop_check_waiting

private long drop_check_waiting

connectionList

protected ConnectionList connectionList

shutdown

protected boolean shutdown

connectionData

protected ConnectionData connectionData

router

protected Router router
Constructor Detail

OutgoingConnectionManager

OutgoingConnectionManager(IncomingConnectionManager incomingConnectionMgr,
                          Router router,
                          HostCache hostCache,
                          ConnectionList connectionList,
                          ConnectionData connectionData)
                    throws java.io.IOException
Constructs the outgoing connection manager

Method Detail

run

public void run()

setDesiredConnectionCount

void setDesiredConnectionCount(int count)
Set the desired connection count

Parameters:
count - desired connection count

getDesiredConnectionCount

int getDesiredConnectionCount()
Get the desired connection count

Returns:
desired connection count

shutdown

void shutdown()
Closes all connections and stops processing


isShutdown

boolean isShutdown()
Check if the manager is shut down

Returns:
true if shut down, false otherwise

getConnectionList

ConnectionList getConnectionList()
Gets the list of connections

Returns:
connection list