rice.pastry.wire
Class WirePastryNode

java.lang.Object
  extended byrice.pastry.PastryNode
      extended byrice.pastry.dist.DistPastryNode
          extended byrice.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.


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(NodeId id)
          Constructor
 
Method Summary
 void doneNode(NodeHandle bootstrap)
          Called after the node is initialized.
 DatagramManager getDatagramManager()
          Returns the DatagramManager for this pastry node.
 DistNodeHandlePool getNodeHandlePool()
          Returns the WireNodeHandlePool for this pastry node.
 SelectorManager getSelectorManager()
          Returns the SelectorManager for this pastry node.
 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 when the node is initialized
 void setSocketElements(java.net.InetSocketAddress address, SelectorManager manager, DatagramManager dManager, SocketManager sManager, 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(NodeId id)
Constructor

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

getSelectorManager

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

Returns:
The SelectorManager for this pastry node.

getDatagramManager

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

Returns:
The DatagramManager for this pastry node.

getSocketManager

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

Returns:
The SocketManager for this pastry node.

getNodeHandlePool

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

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

setSocketElements

public void setSocketElements(java.net.InetSocketAddress address,
                              SelectorManager manager,
                              DatagramManager dManager,
                              SocketManager sManager,
                              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.
dManager - The new SocketElements value
sManager - The new SocketElements value

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(NodeHandle bootstrap)
Called after the node is initialized.

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

nodeIsReady

public void nodeIsReady()
called when the node is initialized

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





Imprint-Dataprotection