rice.pastry.rmi
Class RMINodeHandle
- public class RMINodeHandle
- extends rice.pastry.dist.DistNodeHandle
- A locally stored node handle that points to a remote RMIRemoteNodeI. Need localnode within handle for three reasons: to determine isLocal (thus alive and proximity() = 0), to set senderId in messages (used for coalescing on the other end), and to bounce messages back to self on failure.
- Version:
- $Id: RMINodeHandle.java,v 1.37 2002/09/05 01:37:37 druschel Exp $
- Author:
- Sitaram Iyer
RMINodeHandle
public RMINodeHandle(rice.pastry.rmi.RMIRemoteNodeI rn,
rice.pastry.NodeId nid)
- Constructor. rn could be the local node, in which case this elegantly folds in the terrible ProxyNodeHandle stuff (since the RMI node acts as a proxy).
- Parameters:
rn
- pastry node for whom we're constructing a handle.
nid
- its node id.
RMINodeHandle
public RMINodeHandle(rice.pastry.rmi.RMIRemoteNodeI rn,
rice.pastry.NodeId nid,
rice.pastry.PastryNode pn)
- Alternate constructor with local Pastry node.
- Parameters:
rn
- pastry node for whom we're constructing a handle.
nid
- its node id.
pn
- local Pastry node.
getRemote
public rice.pastry.rmi.RMIRemoteNodeI getRemote()
- Remotenode accessor method. Same as redirect.getRemote().
- Returns:
- RMI remote reference to Pastry node.
setRemoteNode
public void setRemoteNode(rice.pastry.rmi.RMIRemoteNodeI rn)
- Remotenode accessor method.
- Parameters:
rn
- RMI remote reference to some Pastry node.
receiveMessageImpl
public void receiveMessageImpl(rice.pastry.messaging.Message msg)
- Called to send a message to the node corresponding to this handle.
- Parameters:
msg
- Message to be delivered, may or may not be routeMessage.
pingImpl
public boolean pingImpl()
- Ping the remote node now, and update the proximity metric.
- Returns:
- liveness of remote node.