ePOST API

rice.pastry.standard
Class PeriodicLeafSetProtocol

java.lang.Object
  extended by rice.pastry.client.PastryAppl
      extended by rice.pastry.standard.PeriodicLeafSetProtocol
All Implemented Interfaces:
MessageReceiver

public class PeriodicLeafSetProtocol
extends PastryAppl

An implementation of a periodic-style leafset protocol

Version:
$Id: PeriodicLeafSetProtocol.java 2862 2005-12-20 10:09:37Z jeffh $
Author:
Alan Mislove

Field Summary
 int CHECK_LIVENESS_PERIOD
           
protected  Credentials cred
           
protected  java.util.WeakHashMap lastTimeReceivedBLS
          NodeHandle -> Long remembers the TIME when we received a BLS from that NodeHandle
protected  LeafSet leafSet
           
protected  NodeHandle localHandle
           
protected  PastryNode localNode
           
 int PING_NEIGHBOR_PERIOD
          Related to rapidly determining direct neighbor liveness.
protected  RoutingTable routeTable
           
protected  PastrySecurityManager security
           
 
Fields inherited from class rice.pastry.client.PastryAppl
address, instance, logger, thePastryNode
 
Constructor Summary
PeriodicLeafSetProtocol(PastryNode ln, NodeHandle local, PastrySecurityManager sm, LeafSet ls, RoutingTable rt)
          Builds a periodic leafset protocol
 
Method Summary
protected  void broadcastAll()
          Broadcast the leaf set to all members of the local leaf set.
 boolean deliverWhenNotReady()
          We always want to receive messages.
 void destroy()
          Called when PastryNode is destroyed.
 Address getAddress()
          Get address.
 Credentials getCredentials()
          Returns the credentials of this application.
 void messageForAppl(Message msg)
          Should not be called becasue we are overriding the receiveMessage() interface anyway.
 void receiveMessage(Message msg)
          Receives messages.
 
Methods inherited from class rice.pastry.client.PastryAppl
enrouteMessage, getLeafSet, getNodeHandle, getNodeId, getRoutingTable, isClosest, leafSetChange, notifyReady, register, registerReceiver, routeMsg, routeMsgDirect, routeSetChange, sendMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

localHandle

protected NodeHandle localHandle

localNode

protected PastryNode localNode

security

protected PastrySecurityManager security

leafSet

protected LeafSet leafSet

routeTable

protected RoutingTable routeTable

lastTimeReceivedBLS

protected java.util.WeakHashMap lastTimeReceivedBLS
NodeHandle -> Long remembers the TIME when we received a BLS from that NodeHandle


PING_NEIGHBOR_PERIOD

public final int PING_NEIGHBOR_PERIOD
Related to rapidly determining direct neighbor liveness.


CHECK_LIVENESS_PERIOD

public final int CHECK_LIVENESS_PERIOD

cred

protected Credentials cred
Constructor Detail

PeriodicLeafSetProtocol

public PeriodicLeafSetProtocol(PastryNode ln,
                               NodeHandle local,
                               PastrySecurityManager sm,
                               LeafSet ls,
                               RoutingTable rt)
Builds a periodic leafset protocol

Method Detail

receiveMessage

public void receiveMessage(Message msg)
Receives messages.

Specified by:
receiveMessage in interface MessageReceiver
Overrides:
receiveMessage in class PastryAppl
Parameters:
msg - the message.

broadcastAll

protected void broadcastAll()
Broadcast the leaf set to all members of the local leaf set.

Parameters:
type - the type of broadcast message used

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.

getCredentials

public Credentials getCredentials()
Description copied from class: PastryAppl
Returns the credentials of this application.

Specified by:
getCredentials in class PastryAppl
Returns:
the credentials.

getAddress

public Address getAddress()
Get address.

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

deliverWhenNotReady

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

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

destroy

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

Overrides:
destroy in class PastryAppl

ePOST API

Copyright © 2001-2005 - Rice Pastry.