rice.pastry.rmi
Class RMIPastryNodeFactory

public class RMIPastryNodeFactory
extends rice.pastry.dist.DistPastryNodeFactory
Pastry node factory for RMI-linked nodes.
Version:
$Id: RMIPastryNodeFactory.java,v 1.31 2002/09/12 05:51:41 druschel Exp $
Author:
Andrew Ladd
Sitaram Iyer
Field Detail

leafSetMaintFreq

private static final int leafSetMaintFreq
Large period (in seconds) means infrequent, 0 means never.

rmiRegistry

public static java.rmi.registry.Registry rmiRegistry
Instance of RMI registry ever-created when using this factory.

Constructor Detail

RMIPastryNodeFactory

public RMIPastryNodeFactory(rice.pastry.NodeIdFactory nf,
                            int p)
Constructor.
Parameters:
p - RMI registry port.

Method Detail

generateNodeHandle

public rice.pastry.NodeHandle generateNodeHandle(java.net.InetSocketAddress address)
Specified by the DistPastryNodeFactory class. The first looks on the local machine (at the port p) to determine if there is an node bound there. If so, it retrieves the rmiNodeHanlde from that node. If not, this method then looks at the address address to see if there is a pastry node bound there.
Parameters:
address - The address to look for the node.
Returns:
A NodeHandle cooresponding to the remote node at address, or null if none is found.

pause

public synchronized void pause(int ms)
Pauses the current thread for ms milliseconds.
Parameters:
ms - The number of milliseconds to pause.

newNode

public rice.pastry.PastryNode newNode(rice.pastry.NodeHandle bootstrap)
Makes many policy choices and manufactures a new RMIPastryNode. Creates a series of artifacts to adorn the node, like a security manager, a leafset, etc. with hand-picked parameters like the leaf set size. Finally calls the respective setElements to pass these on to the {,RMI,Direct}PastryNode as appropriate, and then calls node.doneNode() (which internally performs mechanisms like exporting the node and notifying applications).
Parameters:
bootstrap - Node handle to bootstrap from.