|
Rice Pastry API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Observable
rice.p2p.commonapi.NodeHandle
rice.pastry.NodeHandle
rice.pastry.dist.DistNodeHandle
rice.pastry.dist.DistCoalesedNodeHandle
Abstract class for handles to "real" remote nodes. This class abstracts out the node handle verification which is necessary in the "real" pastry protocols, since NodeHandles are sent across the wire.
Field Summary | |
static int |
DEFAULT_DISTANCE
DESCRIBE THE FIELD |
protected boolean |
isInPool
DESCRIBE THE FIELD |
protected boolean |
isLocal
DESCRIBE THE FIELD |
protected int |
status
DESCRIBE THE FIELD |
Fields inherited from class rice.pastry.dist.DistNodeHandle |
address, epoch, nodeId |
Fields inherited from class rice.pastry.NodeHandle |
LIVENESS_ALIVE, LIVENESS_DEAD, LIVENESS_SUSPECTED, localnode |
Fields inherited from class rice.p2p.commonapi.NodeHandle |
DECLARED_DEAD, DECLARED_LIVE, PROXIMITY_CHANGED |
Fields inherited from interface rice.pastry.LocalNodeI |
pending |
Constructor Summary | |
DistCoalesedNodeHandle(NodeId nodeId,
java.net.InetSocketAddress address)
Constructor |
Method Summary | |
void |
addObserver(java.util.Observer o)
Adds a feature to the Observer attribute of the DistCoalesedNodeHandle object |
void |
afterSetLocalNode()
Method called from LocalNode after localnode is set to non-null. |
protected void |
clearChanged()
DESCRIBE THE METHOD |
int |
countObservers()
DESCRIBE THE METHOD |
protected void |
debug(java.lang.String s)
Prints out nicely formatted debug messages. |
void |
deleteObserver(java.util.Observer o)
DESCRIBE THE METHOD |
void |
deleteObservers()
DESCRIBE THE METHOD |
boolean |
equals(java.lang.Object obj)
Equivalence relation for nodehandles. |
boolean |
getIsInPool()
Returns whether or not this node handle is the one in the node handle pool. |
int |
getLiveness()
Returns the last known liveness information about the Pastry node associated with this handle. |
boolean |
hasChanged()
DESCRIBE THE METHOD |
int |
hashCode()
Hash codes for node handles. |
void |
markAlive()
Marks this handle as alive (if dead earlier), and reset distance to infinity. |
void |
markDead()
Mark this handle as dead (if alive earlier), and reset distance to infinity. |
void |
notifyObservers()
DESCRIBE THE METHOD |
void |
notifyObservers(java.lang.Object arg)
DESCRIBE THE METHOD |
boolean |
ping()
Ping the node. |
protected abstract boolean |
pingImpl()
Ping the node. |
int |
proximity()
Returns the last known proximity information about the Pastry node associated with this handle. |
void |
receiveMessage(Message message)
Called to send a message to the node corresponding to this handle. |
protected abstract void |
receiveMessageImpl(Message message)
Called to send a message to the node corresponding to this handle. |
protected void |
setChanged()
Sets the Changed attribute of the DistCoalesedNodeHandle object |
void |
setIsInPool(boolean iip)
Sets whether or not this node handle is in the node handle pool. |
protected void |
setProximity(int value)
Method which is designed to be called by subclassses whenever there is a change in the distance metric. |
java.lang.String |
toString()
Returns a String representation of this DistNodeHandle. |
protected abstract java.lang.String |
toStringImpl()
Returns a String representation of this DistNodeHandle. |
void |
update(java.util.Observable o,
java.lang.Object obj)
DESCRIBE THE METHOD |
Methods inherited from class rice.pastry.dist.DistNodeHandle |
getAddress, getEpoch, getNodeId |
Methods inherited from class rice.pastry.NodeHandle |
assertLocalNode, bootstrap, checkLiveness, getId, getLocalNode, isAlive, setLocalNode |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
protected transient boolean isInPool
protected transient int status
protected transient boolean isLocal
public static int DEFAULT_DISTANCE
Constructor Detail |
public DistCoalesedNodeHandle(NodeId nodeId, java.net.InetSocketAddress address)
nodeId
- This node handle's node Id.address
- DESCRIBE THE PARAMETERMethod Detail |
public final int getLiveness()
getLiveness
in class NodeHandle
public boolean getIsInPool()
protected final void setProximity(int value)
value
- The new distance valuepublic void setIsInPool(boolean iip)
iip
- Whether or not this node handle is in the node handle pool.protected void setChanged()
public void afterSetLocalNode()
afterSetLocalNode
in class NodeHandle
public final void markAlive()
public final void markDead()
public final int proximity()
proximity
in class NodeHandle
public final boolean ping()
ping
in class NodeHandle
protected abstract boolean pingImpl()
public final void receiveMessage(Message message)
message
- DESCRIBE THE PARAMETERprotected abstract void receiveMessageImpl(Message message)
message
- DESCRIBE THE PARAMETERpublic final java.lang.String toString()
toString
in class DistNodeHandle
protected abstract java.lang.String toStringImpl()
public boolean equals(java.lang.Object obj)
equals
in class DistNodeHandle
obj
- the other nodehandle .
public int hashCode()
hashCode
in class DistNodeHandle
protected void debug(java.lang.String s)
s
- The message to print.public void addObserver(java.util.Observer o)
o
- The feature to be added to the Observer attributepublic int countObservers()
public void deleteObserver(java.util.Observer o)
o
- DESCRIBE THE PARAMETERpublic void deleteObservers()
public boolean hasChanged()
public void notifyObservers()
public void notifyObservers(java.lang.Object arg)
arg
- DESCRIBE THE PARAMETERprotected void clearChanged()
public void update(java.util.Observable o, java.lang.Object obj)
o
- DESCRIBE THE PARAMETERobj
- DESCRIBE THE PARAMETER
|
Rice Pastry API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |