Rice Pastry API

rice.pastry.socket
Class SocketSourceRouteManager.AddressManager.SourceRouteManager

java.lang.Object
  extended by rice.pastry.socket.SocketSourceRouteManager.AddressManager.SourceRouteManager
Enclosing class:
SocketSourceRouteManager.AddressManager

public class SocketSourceRouteManager.AddressManager.SourceRouteManager
extends java.lang.Object

Internal class which is charges with managing the remote connection via a specific route


Field Summary
protected  int liveness
           
protected  boolean pending
           
protected  int proximity
           
protected  long proximityTimeout
           
protected  SourceRoute route
           
protected  long updated
           
 
Constructor Summary
SocketSourceRouteManager.AddressManager.SourceRouteManager(SourceRoute route)
          Constructor - builds a route manager given the route
 
Method Summary
protected  boolean checkLiveness()
          Method which checks to see this route is dead.
 void connect(int appId, AppSocketReceiver receiver, int timeout)
          Method which opens a socket along this route
 boolean isOpen()
          Returns whether or not a socket is currently open to this route
protected  void markAlive()
          This method should be called when this route is declared alive.
protected  void markDead()
          This method should be called when this route is declared dead.
protected  void markProximity(int proximity)
          This method should be called when this route has its proximity updated
protected  void markSuspected()
          This method should be called when this route is declared suspected.
 void ping()
          Method which suggests a ping to the remote node.
 int proximity()
          Method which returns the last cached proximity value for the given address.
 int rto()
           
 void send(SocketBuffer message)
          Method which enqueues a message along this route
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

route

protected SourceRoute route

liveness

protected int liveness

proximity

protected int proximity

proximityTimeout

protected long proximityTimeout

updated

protected long updated

pending

protected boolean pending
Constructor Detail

SocketSourceRouteManager.AddressManager.SourceRouteManager

public SocketSourceRouteManager.AddressManager.SourceRouteManager(SourceRoute route)
Constructor - builds a route manager given the route

Parameters:
route - The route
Method Detail

rto

public int rto()

proximity

public int proximity()
Method which returns the last cached proximity value for the given address. If there is no cached value, then DEFAULT_PROXIMITY is returned.

Parameters:
address - The address to return the value for
Returns:
The ping value to the remote address

markAlive

protected void markAlive()
This method should be called when this route is declared alive.


markSuspected

protected void markSuspected()
This method should be called when this route is declared suspected.


markDead

protected void markDead()
This method should be called when this route is declared dead.


markProximity

protected void markProximity(int proximity)
This method should be called when this route has its proximity updated

Parameters:
proximity - The proximity

checkLiveness

protected boolean checkLiveness()
Method which checks to see this route is dead. If this address has been checked within the past CHECK_DEAD_THROTTLE millis, then this method does not actually do a check.

Returns:
Whether or not a check will actually be carried out

send

public void send(SocketBuffer message)
Method which enqueues a message along this route

Parameters:
message - The message to send

connect

public void connect(int appId,
                    AppSocketReceiver receiver,
                    int timeout)
Method which opens a socket along this route

Parameters:
message - The message to send

ping

public void ping()
Method which suggests a ping to the remote node.


isOpen

public boolean isOpen()
Returns whether or not a socket is currently open to this route

Returns:
Whether or not a socket is currently open to this route

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection