Rice Pastry API

rice.pastry.standard
Class RapidRerouter

java.lang.Object
  extended by rice.pastry.client.PastryAppl
      extended by rice.pastry.standard.StandardRouter
          extended by rice.pastry.standard.RapidRerouter
All Implemented Interfaces:
LivenessListener<NodeHandle>, LivenessTypes, Router

public class RapidRerouter
extends StandardRouter
implements LivenessListener<NodeHandle>

The superclass makes the routing decisions. This class handles the rapid-rerouting.

Author:
Jeff Hoye

Field Summary
static int MAX_RETRIES
          The max times to try to reroute a message.
 
Fields inherited from class rice.pastry.standard.StandardRouter
lastTimeSentRouteTablePatch, ROUTE_TABLE_PATCH_THROTTLE, routerStrategy
 
Fields inherited from class rice.pastry.client.PastryAppl
address, deserializer, instance, logger, options, receiver, thePastryNode
 
Fields inherited from interface org.mpisws.p2p.transport.liveness.LivenessTypes
LIVENESS_ALIVE, LIVENESS_DEAD, LIVENESS_DEAD_FOREVER, LIVENESS_SUSPECTED
 
Constructor Summary
RapidRerouter(PastryNode thePastryNode, MessageDispatch dispatch, RouterStrategy strategy)
           
 
Method Summary
 void destroy()
          Called when PastryNode is destroyed.
 void livenessChanged(NodeHandle i, int val, java.util.Map<java.lang.String,java.lang.Object> options)
          Called when the liveness changes.
protected  void rerouteMe(RouteMessage rm, NodeHandle oldDest, java.lang.Exception ioe)
           
protected  void sendTheMessage(RouteMessage rm, NodeHandle handle)
           
 
Methods inherited from class rice.pastry.standard.StandardRouter
deliverToApplication, deliverWhenNotReady, getBestRoutingCandidates, getBestRoutingCandidates, getLSCollection, messageForAppl, receiveMessage, route, routeMessage, setRouterStrategy
 
Methods inherited from class rice.pastry.client.PastryAppl
accept, canReceiveSocket, connect, enrouteMessage, finishReceiveSocket, getAddress, getDeserializer, getLeafSet, getNodeHandle, getNodeId, getRoutingTable, isClosest, leafSetChange, notifyReady, receiveMessageInternal, register, routeMsg, routeMsg, routeMsgDirect, routeSetChange, setDeserializer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_RETRIES

public static final int MAX_RETRIES
The max times to try to reroute a message.

See Also:
Constant Field Values
Constructor Detail

RapidRerouter

public RapidRerouter(PastryNode thePastryNode,
                     MessageDispatch dispatch,
                     RouterStrategy strategy)
Method Detail

sendTheMessage

protected void sendTheMessage(RouteMessage rm,
                              NodeHandle handle)
Overrides:
sendTheMessage in class StandardRouter

rerouteMe

protected void rerouteMe(RouteMessage rm,
                         NodeHandle oldDest,
                         java.lang.Exception ioe)

livenessChanged

public void livenessChanged(NodeHandle i,
                            int val,
                            java.util.Map<java.lang.String,java.lang.Object> options)
Description copied from interface: LivenessListener
Called when the liveness changes.

Specified by:
livenessChanged in interface LivenessListener<NodeHandle>

destroy

public void destroy()
Description copied from class: PastryAppl
Called when PastryNode is destroyed. Can be overloaded by applications.

Overrides:
destroy in class PastryAppl

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection