Rice Pastry API

rice.pastry.wire
Class WirePastryNode

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

public class WirePastryNode
extends DistPastryNode

An Socket-based Pastry node, which has two threads - one thread for performing route set and leaf set maintainance, and another thread for listening on the sockets and performing all non-blocking I/O.

Version:
$Id: WirePastryNode.java,v 1.5 2003/03/15 20:33:10 druschel Exp $
Author:
Alan Mislove

Field Summary
 
Fields inherited from class rice.pastry.dist.DistPastryNode
leafSetMaintFreq, routeSetMaintFreq
 
Fields inherited from class rice.pastry.PastryNode
apps, localhandle, myNodeId
 
Constructor Summary
WirePastryNode(rice.pastry.NodeId id)
          Constructor
 
Method Summary
 void doneNode(rice.pastry.NodeHandle bootstrap)
          Called after the node is initialized.
 rice.pastry.wire.DatagramManager getDatagramManager()
          Returns the DatagramManager for this pastry node.
 rice.pastry.dist.DistNodeHandlePool getNodeHandlePool()
          Returns the WireNodeHandlePool for this pastry node.
 rice.pastry.wire.SelectorManager getSelectorManager()
          Returns the SelectorManager for this pastry node.
 rice.pastry.wire.SocketManager getSocketManager()
          Returns the SocketManager for this pastry node.
 boolean inThread()
          Checks whether the current thread is the execution thread.
 void kill()
          Method for simulating the death of this node.
 void nodeIsReady()
          Called from PastryNode when the join succeeds.
 void setSocketElements(java.net.InetSocketAddress address, rice.pastry.wire.SelectorManager manager, rice.pastry.wire.DatagramManager dManager, rice.pastry.wire.SocketManager sManager, rice.pastry.wire.WireNodeHandlePool pool, int lsmf, int rsmf)
          Helper method which allows the WirePastryNodeFactory to initialize a number of the pastry node's elements.
 void setThread(java.lang.Thread t)
          Sets the thread which the pastry node is running in.
 
Methods inherited from class rice.pastry.dist.DistPastryNode
initiateJoin, scheduleMsg, scheduleMsg, scheduleMsgAtFixedRate
 
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
 

Constructor Detail

WirePastryNode

public WirePastryNode(rice.pastry.NodeId id)
Constructor

Parameters:
id - The NodeId of this Pastry node.
Method Detail

setSocketElements

public void setSocketElements(java.net.InetSocketAddress address,
                              rice.pastry.wire.SelectorManager manager,
                              rice.pastry.wire.DatagramManager dManager,
                              rice.pastry.wire.SocketManager sManager,
                              rice.pastry.wire.WireNodeHandlePool pool,
                              int lsmf,
                              int rsmf)
Helper method which allows the WirePastryNodeFactory to initialize a number of the pastry node's elements.

Parameters:
address - The address of this pastry node.
manager - The socket manager for this pastry node.
pool - The node handle pool for this pastry node.
lsmf - Leaf set maintenance frequency. 0 means never.
rsmf - Route set maintenance frequency. 0 means never.

setThread

public void setThread(java.lang.Thread t)
Sets the thread which the pastry node is running in.

Parameters:
t - The thread

inThread

public boolean inThread()
Checks whether the current thread is the execution thread.

Returns:
whether or not the current thread is the executing thread

doneNode

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

Overrides:
doneNode in class DistPastryNode
Parameters:
bootstrap - The node which this node should boot off of.

getSelectorManager

public rice.pastry.wire.SelectorManager getSelectorManager()
Returns the SelectorManager for this pastry node.

Returns:
The SelectorManager for this pastry node.

getDatagramManager

public rice.pastry.wire.DatagramManager getDatagramManager()
Returns the DatagramManager for this pastry node.

Returns:
The DatagramManager for this pastry node.

getSocketManager

public rice.pastry.wire.SocketManager getSocketManager()
Returns the SocketManager for this pastry node.

Returns:
The SocketManager for this pastry node.

getNodeHandlePool

public rice.pastry.dist.DistNodeHandlePool getNodeHandlePool()
Returns the WireNodeHandlePool for this pastry node.

Specified by:
getNodeHandlePool in class DistPastryNode
Returns:
The WireNodeHandlePool for this pastry node.

nodeIsReady

public void nodeIsReady()
Description copied from class: DistPastryNode
Called from PastryNode when the join succeeds.

Overrides:
nodeIsReady in class DistPastryNode

kill

public void kill()
Method for simulating the death of this node. Should only be used for testing purposes.

Overrides:
kill in class DistPastryNode

Rice Pastry API

Copyright © 2001 - Rice Pastry.


Imprint-Dataprotection