|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrice.pastry.client.PastryAppl
rice.pastry.standard.PeriodicLeafSetProtocol
public class PeriodicLeafSetProtocol
An implementation of a periodic-style leafset protocol
Nested Class Summary | |
---|---|
static class |
PeriodicLeafSetProtocol.PLSPMessageDeserializer
|
Field Summary | |
---|---|
int |
BLS_THROTTLE
|
int |
CHECK_LIVENESS_PERIOD
|
protected java.util.WeakHashMap |
lastTimeReceivedBLS
NodeHandle -> Long remembers the TIME when we received a BLS from that NodeHandle |
protected java.util.WeakHashMap |
lastTimeSentBLS
|
protected LeafSet |
leafSet
|
int |
LEASE_PERIOD
|
protected NodeHandle |
localHandle
|
protected PastryNode |
localNode
|
int |
PING_NEIGHBOR_PERIOD
Related to rapidly determining direct neighbor liveness. |
protected RoutingTable |
routeTable
|
Fields inherited from class rice.pastry.client.PastryAppl |
---|
address, deserializer, instance, logger, receiver, thePastryNode |
Constructor Summary | |
---|---|
PeriodicLeafSetProtocol(PastryNode ln,
NodeHandle local,
LeafSet ls,
RoutingTable rt)
Builds a periodic leafset protocol |
Method Summary | |
---|---|
protected void |
broadcastAll()
Broadcast the leaf set to all members of the local leaf set. |
boolean |
deliverWhenNotReady()
We always want to receive messages. |
void |
destroy()
Called when PastryNode is destroyed. |
boolean |
isReady()
Gets the Ready attribute of the ReadyStrategy object |
void |
leafSetChange(NodeHandle nh,
boolean wasAdded)
Called by pastry when the leaf set changes. |
void |
messageForAppl(Message msg)
Should not be called becasue we are overriding the receiveMessage() interface anyway. |
void |
nodeSetUpdate(NodeSetEventSource nodeSetEventSource,
NodeHandle handle,
boolean added)
DESCRIBE THE METHOD |
void |
receiveMessage(Message msg)
Receives messages. |
void |
setReady(boolean r)
Sets the Ready attribute of the ReadyStrategy object |
boolean |
shouldBeReady()
|
void |
start()
Called when it is time to take over as the renderstrategy. |
void |
update(java.util.Observable o,
java.lang.Object arg)
Only remove the item if you did not give a lease. |
Methods inherited from class rice.pastry.client.PastryAppl |
---|
accept, connect, enrouteMessage, getAddress, getLeafSet, getNodeHandle, getNodeId, getRoutingTable, isClosest, notifyReady, receiveMessageInternal, receiveSocket, register, routeMsg, routeMsgDirect, routeSetChange, setDeserializer |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected NodeHandle localHandle
protected PastryNode localNode
protected LeafSet leafSet
protected RoutingTable routeTable
protected java.util.WeakHashMap lastTimeReceivedBLS
protected java.util.WeakHashMap lastTimeSentBLS
public final int PING_NEIGHBOR_PERIOD
public final int LEASE_PERIOD
public final int CHECK_LIVENESS_PERIOD
public final int BLS_THROTTLE
Constructor Detail |
---|
public PeriodicLeafSetProtocol(PastryNode ln, NodeHandle local, LeafSet ls, RoutingTable rt)
Method Detail |
---|
public void receiveMessage(Message msg)
receiveMessage
in class PastryAppl
msg
- the message.protected void broadcastAll()
type
- the type of broadcast message usedpublic void start()
ReadyStrategy
start
in interface ReadyStrategy
public void nodeSetUpdate(NodeSetEventSource nodeSetEventSource, NodeHandle handle, boolean added)
NodeSetListener
nodeSetUpdate
in interface NodeSetListener
nodeSetEventSource
- DESCRIBE THE PARAMETERhandle
- DESCRIBE THE PARAMETERadded
- DESCRIBE THE PARAMETERpublic void setReady(boolean r)
ReadyStrategy
setReady
in interface ReadyStrategy
r
- The new Ready valuepublic boolean isReady()
ReadyStrategy
isReady
in interface ReadyStrategy
public boolean shouldBeReady()
public void messageForAppl(Message msg)
messageForAppl
in class PastryAppl
msg
- the message that is arriving.public boolean deliverWhenNotReady()
deliverWhenNotReady
in class PastryAppl
public void destroy()
PastryAppl
destroy
in class PastryAppl
public void leafSetChange(NodeHandle nh, boolean wasAdded)
PastryAppl
leafSetChange
in class PastryAppl
nh
- the handle of the node that was added or removed.wasAdded
- true if the node was added, false if the node was removed.public void update(java.util.Observable o, java.lang.Object arg)
update
in interface java.util.Observer
|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |