Rice Pastry API

rice.pastry.standard
Class StandardRouter

java.lang.Object
  extended by rice.pastry.client.PastryAppl
      extended by rice.pastry.standard.StandardRouter

public class StandardRouter
extends PastryAppl

An implementation of the standard Pastry routing algorithm.

Version:
$Id: StandardRouter.java 3574 2007-02-02 13:09:08Z jeffh $
Author:
Andrew Ladd, Rongmei Zhang/Y.Charlie Hu

Field Summary
 
Fields inherited from class rice.pastry.client.PastryAppl
address, deserializer, instance, logger, receiver, thePastryNode
 
Constructor Summary
StandardRouter(PastryNode thePastryNode)
          Constructor.
 
Method Summary
 boolean deliverWhenNotReady()
          Instructs the MessageDispatch how to behave when the PastryNode is not ready.
 void messageForAppl(Message msg)
          Called by pastry when a message arrives for this application.
 void receiveMessage(Message msg)
          Receive a message from a remote node.
 
Methods inherited from class rice.pastry.client.PastryAppl
accept, connect, destroy, enrouteMessage, getAddress, getLeafSet, getNodeHandle, getNodeId, getRoutingTable, isClosest, leafSetChange, notifyReady, receiveMessageInternal, receiveSocket, register, routeMsg, routeMsgDirect, routeSetChange, setDeserializer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandardRouter

public StandardRouter(PastryNode thePastryNode)
Constructor.

Parameters:
rt - the routing table.
ls - the leaf set.
Method Detail

receiveMessage

public void receiveMessage(Message msg)
Receive a message from a remote node.

Overrides:
receiveMessage in class PastryAppl
Parameters:
msg - the message.

deliverWhenNotReady

public boolean deliverWhenNotReady()
Description copied from class: PastryAppl
Instructs the MessageDispatch how to behave when the PastryNode is not ready. An application can override this method to return true if it wishes to receive messages before Pastry is ready(). Most applications should leave this as false, so that their application does not have inconsistent routing. However Pastry's protocols (such as the join protocol) need to receive messages before pastry is ready(). This is because they are attempting to make pastry ready().

Overrides:
deliverWhenNotReady in class PastryAppl
Returns:
false unless the node is a service

messageForAppl

public void messageForAppl(Message msg)
Description copied from class: PastryAppl
Called by pastry when a message arrives for this application.

Specified by:
messageForAppl in class PastryAppl
Parameters:
msg - the message that is arriving.

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection