Rice Pastry API

rice.pastry.dist
Class DistPastryNode

java.lang.Object
  |
  +--rice.pastry.PastryNode
        |
        +--rice.pastry.dist.DistPastryNode
All Implemented Interfaces:
MessageReceiver, Node
Direct Known Subclasses:
RMIPastryNode, WirePastryNode

public abstract class DistPastryNode
extends PastryNode

Class which represents the abstraction of a "real" pastry node. Designed to be extended by the protocol implementation (i.e. RMI or Socket) desired.

Version:
$Id: DistPastryNode.java,v 1.8 2003/05/23 03:55:23 druschel Exp $
Author:
Alan Mislove

Field Summary
protected  int leafSetMaintFreq
           
protected  int routeSetMaintFreq
           
 
Fields inherited from class rice.pastry.PastryNode
apps, localhandle, myNodeId
 
Constructor Summary
protected DistPastryNode(rice.pastry.NodeId id)
          Constructor, with NodeId.
 
Method Summary
 void doneNode(rice.pastry.NodeHandle bootstrap)
          Called after the node is initialized.
abstract  rice.pastry.dist.DistNodeHandlePool getNodeHandlePool()
          Method which returns the Dist for this Pastry node.
 void initiateJoin(rice.pastry.NodeHandle bootstrap)
          Sends an InitiateJoin message to itself.
 void kill()
          Method which kills a PastryNode (used only for testing).
 void nodeIsReady()
          Called from PastryNode when the join succeeds.
 rice.pastry.ScheduledMessage scheduleMsg(rice.pastry.messaging.Message msg, long delay)
          Schedule the specified message to be sent to the local node after a specified delay.
 rice.pastry.ScheduledMessage scheduleMsg(rice.pastry.messaging.Message msg, long delay, long period)
          Schedule the specified message for repeated fixed-delay delivery to the local node, beginning after the specified delay.
 rice.pastry.ScheduledMessage scheduleMsgAtFixedRate(rice.pastry.messaging.Message msg, long delay, long period)
          Schedule the specified message for repeated fixed-rate delivery to the local node, beginning after the specified delay.
 
Methods inherited from class rice.pastry.PastryNode
addLeafSetObserver, addRouteSetObserver, deleteLeafSetObserver, deleteRouteSetObserver, getId, getIdFactory, getLeafSet, getLocalHandle, getMessageDispatch, getNodeId, getRoutingTable, isClosest, isReady, receiveMessage, registerApp, registerApplication, registerReceiver, setElements, setMessageDispatch, setReady, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

leafSetMaintFreq

protected int leafSetMaintFreq

routeSetMaintFreq

protected int routeSetMaintFreq
Constructor Detail

DistPastryNode

protected DistPastryNode(rice.pastry.NodeId id)
Constructor, with NodeId. Need to set the node's ID before this node is inserted as localHandle.localNode.

Method Detail

getNodeHandlePool

public abstract rice.pastry.dist.DistNodeHandlePool getNodeHandlePool()
Method which returns the Dist for this Pastry node.

Returns:
The node handle pool for this pastry node.

initiateJoin

public final void initiateJoin(rice.pastry.NodeHandle bootstrap)
Sends an InitiateJoin message to itself.

Specified by:
initiateJoin in class PastryNode
Parameters:
bootstrap - Node handle to bootstrap with.

nodeIsReady

public void nodeIsReady()
Called from PastryNode when the join succeeds.

Specified by:
nodeIsReady in class PastryNode

doneNode

public void doneNode(rice.pastry.NodeHandle bootstrap)
Called after the node is initialized.


kill

public void kill()
Method which kills a PastryNode (used only for testing).


scheduleMsg

public rice.pastry.ScheduledMessage scheduleMsg(rice.pastry.messaging.Message msg,
                                                long delay)
Schedule the specified message to be sent to the local node after a specified delay. Useful to provide timeouts.

Specified by:
scheduleMsg in class PastryNode
Parameters:
msg - a message that will be delivered to the local node after the specified delay
delay - time in milliseconds before message is to be delivered
Returns:
the scheduled event object; can be used to cancel the message

scheduleMsg

public rice.pastry.ScheduledMessage scheduleMsg(rice.pastry.messaging.Message msg,
                                                long delay,
                                                long period)
Schedule the specified message for repeated fixed-delay delivery to the local node, beginning after the specified delay. Subsequent executions take place at approximately regular intervals separated by the specified period. Useful to initiate periodic tasks.

Specified by:
scheduleMsg in class PastryNode
Parameters:
msg - a message that will be delivered to the local node after the specified delay
delay - time in milliseconds before message is to be delivered
period - time in milliseconds between successive message deliveries
Returns:
the scheduled event object; can be used to cancel the message

scheduleMsgAtFixedRate

public rice.pastry.ScheduledMessage scheduleMsgAtFixedRate(rice.pastry.messaging.Message msg,
                                                           long delay,
                                                           long period)
Schedule the specified message for repeated fixed-rate delivery to the local node, beginning after the specified delay. Subsequent executions take place at approximately regular intervals, separated by the specified period.

Specified by:
scheduleMsgAtFixedRate in class PastryNode
Parameters:
msg - a message that will be delivered to the local node after the specified delay
delay - time in milliseconds before message is to be delivered
period - time in milliseconds between successive message deliveries
Returns:
the scheduled event object; can be used to cancel the message

Rice Pastry API

Copyright © 2001 - Rice Pastry.


Imprint-Dataprotection