Rice Pastry API

rice.pastry.standard
Class StandardJoinProtocol

java.lang.Object
  extended by rice.pastry.client.PastryAppl
      extended by rice.pastry.standard.StandardJoinProtocol
Direct Known Subclasses:
ConsistentJoinProtocol

public class StandardJoinProtocol
extends PastryAppl

An implementation of a simple join protocol.

Version:
$Id: StandardJoinProtocol.java 3524 2007-01-09 14:09:27Z jeffh $
Author:
Peter Druschel, Andrew Ladd, Rongmei Zhang, Y. Charlie Hu

Field Summary
protected  LeafSet leafSet
           
protected  NodeHandle localHandle
           
protected  RoutingTable routeTable
           
 
Fields inherited from class rice.pastry.client.PastryAppl
address, deserializer, instance, logger, receiver, thePastryNode
 
Constructor Summary
StandardJoinProtocol(PastryNode ln, NodeHandle lh, RoutingTable rt, LeafSet ls)
          Constructor.
StandardJoinProtocol(PastryNode ln, NodeHandle lh, RoutingTable rt, LeafSet ls, MessageDeserializer md)
           
 
Method Summary
 void broadcastRows(JoinRequest jr)
          Broadcasts the route table rows.
 boolean deliverWhenNotReady()
          We always want to receive messages.
 int getAddress()
          Get address.
 void messageForAppl(Message msg)
          Should not be called becasue we are overriding the receiveMessage() interface anyway.
 void receiveMessage(Message msg)
          Receives a message from the outside world.
protected  void setReady()
          Can be overloaded to do additional things before going ready.
 
Methods inherited from class rice.pastry.client.PastryAppl
accept, connect, destroy, enrouteMessage, 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
 

Field Detail

localHandle

protected NodeHandle localHandle

routeTable

protected RoutingTable routeTable

leafSet

protected LeafSet leafSet
Constructor Detail

StandardJoinProtocol

public StandardJoinProtocol(PastryNode ln,
                            NodeHandle lh,
                            RoutingTable rt,
                            LeafSet ls)
Constructor.

Parameters:
lh - the local node handle.
sm - the Pastry security manager.

StandardJoinProtocol

public StandardJoinProtocol(PastryNode ln,
                            NodeHandle lh,
                            RoutingTable rt,
                            LeafSet ls,
                            MessageDeserializer md)
Method Detail

getAddress

public int getAddress()
Get address.

Overrides:
getAddress in class PastryAppl
Returns:
gets the address.

receiveMessage

public void receiveMessage(Message msg)
Receives a message from the outside world.

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

setReady

protected void setReady()
Can be overloaded to do additional things before going ready. For example, verifying that other nodes are aware of us, so that consistent routing is guaranteed.


broadcastRows

public void broadcastRows(JoinRequest jr)
Broadcasts the route table rows.

Parameters:
jr - the join row.

messageForAppl

public void messageForAppl(Message msg)
Should not be called becasue we are overriding the receiveMessage() interface anyway.

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

deliverWhenNotReady

public boolean deliverWhenNotReady()
We always want to receive messages.

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

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection