ePOST 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  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.
 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.
 void send(Message message)
          Method which enqueues a message along this route
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

route

protected SourceRoute route

liveness

protected int liveness

proximity

protected int proximity

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

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(Message message)
Method which enqueues a message 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

ePOST API

Copyright © 2001-2005 - Rice Pastry.