| 
Rice Pastry API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectrice.selector.SelectionKeyHandler
rice.pastry.socket.PingManager
public class PingManager
| Nested Class Summary | |
|---|---|
 class | 
PingManager.Envelope
Internal class which holds a pending datagram  | 
| Field Summary | |
|---|---|
 int | 
DATAGRAM_RECEIVE_BUFFER_SIZE
 | 
 int | 
DATAGRAM_SEND_BUFFER_SIZE
 | 
static int | 
HEADER_SIZE
 | 
protected  java.util.Map | 
lastPingTime
 | 
 int | 
MIN_RTT
 | 
protected  java.util.ArrayList | 
pendingMsgs
 | 
static int | 
PING_THROTTLE
 | 
protected  java.util.Map | 
pingListeners
 | 
| Constructor Summary | |
|---|---|
PingManager(SocketPastryNode spn,
            SocketSourceRouteManager manager,
            EpochInetSocketAddress bindAddress,
            EpochInetSocketAddress proxyAddress)
 | 
|
| Method Summary | |
|---|---|
protected  void | 
addPingResponseListener(SourceRoute path,
                        PingResponseListener prl)
Adds a feature to the PingResponseListener attribute of the PingManager object  | 
 SourceRoute | 
decodeHeader(byte[] header,
             int numAddresses)
Method which adds a header for the provided path to the given data.  | 
 void | 
enqueue(SourceRoute path,
        PRawMessage msg)
 | 
 void | 
enqueue(SourceRoute path,
        SocketBuffer msg)
DESCRIBE THE METHOD  | 
 void | 
modifyKey(java.nio.channels.SelectionKey key)
DESCRIBE THE METHOD  | 
protected  void | 
notifyPingResponseListeners(SourceRoute path,
                            int proximity,
                            long lastTimePinged)
caller must synchronized(pingResponseTimes)  | 
protected  void | 
ping(SourceRoute path,
     PingResponseListener prl)
Method which actually sends a ping to over the specified path, and returns the result to the specified listener.  | 
 void | 
read(java.nio.channels.SelectionKey key)
DESCRIBE THE METHOD  | 
protected  void | 
readHeader(java.net.InetSocketAddress address)
Method which processes an incoming message and hands it off to the appropriate handler.  | 
 void | 
receiveMessage(SourceRoute sr,
               DatagramMessage dm,
               int size,
               SourceRoute fromPath)
DESCRIBE THE METHOD  | 
protected  void | 
removePingResponseListener(SourceRoute path,
                           PingResponseListener prl)
Adds a feature to the PingResponseListener attribute of the PingManager object  | 
protected  void | 
resign()
Makes this node resign from the network.  | 
 void | 
stall()
Internal testing method which simulates a stall.  | 
 void | 
write(java.nio.channels.SelectionKey key)
DESCRIBE THE METHOD  | 
| Methods inherited from class rice.selector.SelectionKeyHandler | 
|---|
accept, connect | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
public static final int PING_THROTTLE
public static final int HEADER_SIZE
public final int DATAGRAM_RECEIVE_BUFFER_SIZE
public final int DATAGRAM_SEND_BUFFER_SIZE
public final int MIN_RTT
protected java.util.Map pingListeners
protected java.util.Map lastPingTime
protected java.util.ArrayList pendingMsgs
| Constructor Detail | 
|---|
public PingManager(SocketPastryNode spn,
                   SocketSourceRouteManager manager,
                   EpochInetSocketAddress bindAddress,
                   EpochInetSocketAddress proxyAddress)
            throws java.io.IOException
port - DESCRIBE THE PARAMETERmanager - DESCRIBE THE PARAMETERpool - DESCRIBE THE PARAMETER
java.io.IOException| Method Detail | 
|---|
protected void ping(SourceRoute path,
                    PingResponseListener prl)
path - The path to send the ping overprl - The listener which should hear about the response
protected void resign()
               throws java.io.IOException
java.io.IOExceptionpublic void stall()
protected void removePingResponseListener(SourceRoute path,
                                          PingResponseListener prl)
address - The feature to be added to the PingResponseListener
      attributeprl - The feature to be added to the PingResponseListener attribute
protected void addPingResponseListener(SourceRoute path,
                                       PingResponseListener prl)
address - The feature to be added to the PingResponseListener
      attributeprl - The feature to be added to the PingResponseListener attribute
protected void notifyPingResponseListeners(SourceRoute path,
                                           int proximity,
                                           long lastTimePinged)
address - proximity - lastTimePinged - 
public void enqueue(SourceRoute path,
                    PRawMessage msg)
public void enqueue(SourceRoute path,
                    SocketBuffer msg)
address - DESCRIBE THE PARAMETERmsg - DESCRIBE THE PARAMETER
public void receiveMessage(SourceRoute sr,
                           DatagramMessage dm,
                           int size,
                           SourceRoute fromPath)
                    throws java.io.IOException
message - DESCRIBE THE PARAMETERaddress - DESCRIBE THE PARAMETER
java.io.IOExceptionpublic void read(java.nio.channels.SelectionKey key)
read in class SelectionKeyHandlerkey - DESCRIBE THE PARAMETERpublic void write(java.nio.channels.SelectionKey key)
write in class SelectionKeyHandlerkey - DESCRIBE THE PARAMETERpublic void modifyKey(java.nio.channels.SelectionKey key)
modifyKey in class SelectionKeyHandlerkey - DESCRIBE THE PARAMETER
public SourceRoute decodeHeader(byte[] header,
                                int numAddresses)
                         throws java.io.IOException
java.io.IOException
protected void readHeader(java.net.InetSocketAddress address)
                   throws java.io.IOException
java.io.IOException
  | 
Rice Pastry API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||