rice.pastry.wire
Class WirePastryNode

public class WirePastryNode
extends rice.pastry.dist.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.4 2002/09/04 04:50:00 druschel Exp $
Author:
Alan Mislove
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.
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.
Returns:
The WireNodeHandlePool for this pastry node.

kill

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