ucr.core
Class ConnectionManager

java.lang.Object
  extended byjava.lang.Thread
      extended byucr.core.ConnectionManager
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
IncomingConnectionManager, OutgoingConnectionManager

abstract class ConnectionManager
extends java.lang.Thread

Base class for connection managers


Field Summary
protected  ConnectionData connectionData
           
protected  ConnectionList connectionList
           
private  int desiredConnectionCount
           
protected  Router router
           
protected  boolean shutdown
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
(package private) ConnectionManager(Router router, ConnectionList connectionList, ConnectionData connectionData)
          Connection management constructor
 
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
(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, run, 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

desiredConnectionCount

private int desiredConnectionCount

connectionList

protected ConnectionList connectionList

shutdown

protected boolean shutdown

connectionData

protected ConnectionData connectionData

router

protected Router router
Constructor Detail

ConnectionManager

ConnectionManager(Router router,
                  ConnectionList connectionList,
                  ConnectionData connectionData)
Connection management constructor

Parameters:
router - message router
connectionList - list of active connections
connectionData - connection data for the system
Method Detail

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