rice.pastry.wire
Class GlobalSocketManager

java.lang.Object
  extended byrice.pastry.wire.SocketManager
      extended byrice.pastry.wire.GlobalSocketManager
All Implemented Interfaces:
SelectionKeyHandler

public class GlobalSocketManager
extends SocketManager

This is one of the first steps toward a centrally managed wire protocol that can support OS level limitations such as FileDescriptor limits. This object has static lists of the sockets open to other connections. This way such a list is maintained process wide since the number of FDs is a per-process count.


Field Summary
 
Fields inherited from class rice.pastry.wire.SocketManager
MAX_OPEN_SOCKETS, openSockets
 
Constructor Summary
GlobalSocketManager(WirePastryNode node, int port, java.nio.channels.Selector selector)
          Constructs a new GlobalSocketManager.
 
Method Summary
protected  java.util.LinkedList generateOpenSockets()
          Returns the staticlly allocated list.
protected  boolean needToDisconnectSockets()
          asks the socketmanager wether to call removeOpenSocketsIfNeeded
 
Methods inherited from class rice.pastry.wire.SocketManager
accept, closeSocket, connect, openSocket, read, removeOpenSocketsIfNeeded, update, wakeup, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GlobalSocketManager

public GlobalSocketManager(WirePastryNode node,
                           int port,
                           java.nio.channels.Selector selector)
Constructs a new GlobalSocketManager.

Parameters:
node - The pastry node this manager is serving
port - The port number which this manager is listening on
selector - The Selector this manager should register with
Method Detail

generateOpenSockets

protected java.util.LinkedList generateOpenSockets()
Returns the staticlly allocated list.

Overrides:
generateOpenSockets in class SocketManager
Returns:
a LinkedList to remember what sockets are open

needToDisconnectSockets

protected boolean needToDisconnectSockets()
asks the socketmanager wether to call removeOpenSocketsIfNeeded

Overrides:
needToDisconnectSockets in class SocketManager
Returns:
wether to disconnect some sockets





Imprint-Dataprotection