Rice Pastry API

rice.pastry.rmi
Class RMIPastryNode

java.lang.Object
  |
  +--rice.pastry.PastryNode
        |
        +--rice.pastry.dist.DistPastryNode
              |
              +--rice.pastry.rmi.RMIPastryNode
All Implemented Interfaces:
MessageReceiver, Node, java.rmi.Remote, RMIRemoteNodeI

public class RMIPastryNode
extends DistPastryNode
implements RMIRemoteNodeI

An RMI-exported Pastry node. Its remote interface is exported over RMI.

Version:
$Id: RMIPastryNode.java,v 1.36 2003/08/25 04:24:25 amislove Exp $
Author:
Sitaram Iyer

Field Summary
 
Fields inherited from class rice.pastry.dist.DistPastryNode
leafSetMaintFreq, routeSetMaintFreq
 
Fields inherited from class rice.pastry.PastryNode
apps, localhandle, myNodeId
 
Constructor Summary
RMIPastryNode(rice.pastry.NodeId id)
          Constructor
 
Method Summary
 void doneNode(rice.pastry.NodeHandle bootstrap)
          Called after the node is initialized.
 void enqueueSendMsg(rice.pastry.messaging.Message msg, rice.pastry.rmi.RMINodeHandle handle)
          Enqueues a message for asynchronous transmission
 rice.pastry.dist.DistNodeHandlePool getNodeHandlePool()
          accessor method for RMI handle pool.
 rice.pastry.routing.RouteSet[] getRouteRow(int row)
          Returns the given row of the routing table
 void kill()
          Testing purposes only!
 void nodeIsReady()
          Called from PastryNode when the join succeeds, whereupon it rebinds the node into the RMI registry.
 void remoteReceiveMessage(rice.pastry.messaging.Message msg, rice.pastry.NodeId hopDest)
          Proxies to the local node to accept a message.
 void setRMIElements(rice.pastry.rmi.RMINodeHandlePool hp, int p, int lsmf, int rsmf)
          accessor method for elements in RMIPastryNode, called by RMIPastryNodeFactory.
 
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
 
Methods inherited from interface rice.pastry.rmi.RMIRemoteNodeI
getLeafSet, getNodeId
 

Constructor Detail

RMIPastryNode

public RMIPastryNode(rice.pastry.NodeId id)
Constructor

Method Detail

setRMIElements

public void setRMIElements(rice.pastry.rmi.RMINodeHandlePool hp,
                           int p,
                           int lsmf,
                           int rsmf)
accessor method for elements in RMIPastryNode, called by RMIPastryNodeFactory.

Parameters:
hp - Node handle pool
p - RMIregistry port
lsmf - Leaf set maintenance frequency. 0 means never.
rsmf - Route set maintenance frequency. 0 means never.

getNodeHandlePool

public rice.pastry.dist.DistNodeHandlePool getNodeHandlePool()
accessor method for RMI handle pool.

Specified by:
getNodeHandlePool in class DistPastryNode
Returns:
handle pool

getRouteRow

public rice.pastry.routing.RouteSet[] getRouteRow(int row)
Returns the given row of the routing table

Specified by:
getRouteRow in interface RMIRemoteNodeI
Returns:
The rowth row of the routing table

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.

nodeIsReady

public final void nodeIsReady()
Called from PastryNode when the join succeeds, whereupon it rebinds the node into the RMI registry. Happens after the registry lookup, so the node never ends up discovering itself.

Overrides:
nodeIsReady in class DistPastryNode

remoteReceiveMessage

public void remoteReceiveMessage(rice.pastry.messaging.Message msg,
                                 rice.pastry.NodeId hopDest)
                          throws java.rmi.RemoteException
Proxies to the local node to accept a message. For synchronization purposes, it only adds the message to the rcvQueue and signals the message handler thread.

Specified by:
remoteReceiveMessage in interface RMIRemoteNodeI
Parameters:
msg - the message
java.rmi.RemoteException

enqueueSendMsg

public void enqueueSendMsg(rice.pastry.messaging.Message msg,
                           rice.pastry.rmi.RMINodeHandle handle)
Enqueues a message for asynchronous transmission

Parameters:
msg - the message (if msg == null, do a ping)
handle - the nodeHandle to which the message should be sent

kill

public void kill()
Testing purposes only!

Overrides:
kill in class DistPastryNode

Rice Pastry API

Copyright © 2001 - Rice Pastry.


Imprint-Dataprotection