|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object rice.pastry.client.PastryAppl rice.pastry.standard.StandardJoinProtocol
public class StandardJoinProtocol
An implementation of a simple join protocol. Overview: initiateJoin() causes InitiateJoinMsg to be sent periodically on the joiner causes handleInitiateJoin() constructs a RouteMessage(JoinRequest) and sends it to the boostrap causes handleIntermediateHop() on each node along the route causes respondToJoiner() on last hop causes completeJoin() on joiner
Nested Class Summary | |
---|---|
static class |
StandardJoinProtocol.SJPDeserializer
|
Field Summary | |
---|---|
protected ScheduledMessage |
joinEvent
|
protected LeafSet |
leafSet
|
protected NodeHandle |
localHandle
|
protected RoutingTable |
routeTable
|
Fields inherited from class rice.pastry.client.PastryAppl |
---|
address, deserializer, instance, logger, options, receiver, thePastryNode |
Constructor Summary | |
---|---|
StandardJoinProtocol(PastryNode ln,
NodeHandle lh,
RoutingTable rt,
LeafSet ls)
Constructor. |
|
StandardJoinProtocol(PastryNode ln,
NodeHandle lh,
RoutingTable rt,
LeafSet ls,
MessageDeserializer md)
|
Method Summary | |
---|---|
void |
broadcastRows(JoinRequest jr)
Broadcasts the route table rows. |
protected void |
completeJoin(JoinRequest jr)
called on the joiner |
boolean |
deliverWhenNotReady()
We always want to receive messages. |
int |
getAddress()
Get address. |
protected void |
getJoinRequest(NodeHandle bootstrap,
Continuation<JoinRequest,java.lang.Exception> deliverJRToMe)
|
protected java.util.Map<java.lang.String,java.lang.Object> |
getOptions(JoinRequest jr,
java.util.Map<java.lang.String,java.lang.Object> existing)
|
protected void |
handleInitiateJoin(InitiateJoin ij)
|
protected void |
handleIntermediateHop(RouteMessage rm)
|
protected void |
handleJoinRequest(JoinRequest jr)
|
void |
initiateJoin(java.util.Collection<NodeHandle> bootstrap)
|
void |
messageForAppl(Message msg)
Should not be called becasue we are overriding the receiveMessage() interface anyway. |
void |
receiveMessage(Message msg)
Receives a message from the outside world. |
protected void |
respondToJoiner(JoinRequest jr)
|
protected void |
setReady()
Can be overloaded to do additional things before going ready. |
Methods inherited from class rice.pastry.client.PastryAppl |
---|
accept, canReceiveSocket, connect, destroy, enrouteMessage, finishReceiveSocket, getDeserializer, getLeafSet, getNodeHandle, getNodeId, getRoutingTable, isClosest, leafSetChange, notifyReady, receiveMessageInternal, register, routeMsg, 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 RoutingTable routeTable
protected LeafSet leafSet
protected ScheduledMessage joinEvent
Constructor Detail |
---|
public StandardJoinProtocol(PastryNode ln, NodeHandle lh, RoutingTable rt, LeafSet ls)
lh
- the local node handle.sm
- the Pastry security manager.public StandardJoinProtocol(PastryNode ln, NodeHandle lh, RoutingTable rt, LeafSet ls, MessageDeserializer md)
Method Detail |
---|
public int getAddress()
getAddress
in class PastryAppl
public void initiateJoin(java.util.Collection<NodeHandle> bootstrap)
initiateJoin
in interface JoinProtocol
public void receiveMessage(Message msg)
receiveMessage
in class PastryAppl
msg
- the message that was received.protected void handleInitiateJoin(InitiateJoin ij)
protected void getJoinRequest(NodeHandle bootstrap, Continuation<JoinRequest,java.lang.Exception> deliverJRToMe)
protected void handleIntermediateHop(RouteMessage rm)
protected void handleJoinRequest(JoinRequest jr)
protected void respondToJoiner(JoinRequest jr)
protected java.util.Map<java.lang.String,java.lang.Object> getOptions(JoinRequest jr, java.util.Map<java.lang.String,java.lang.Object> existing)
protected void completeJoin(JoinRequest jr)
protected void setReady()
public void broadcastRows(JoinRequest jr)
jr
- the join row.public void messageForAppl(Message msg)
messageForAppl
in class PastryAppl
msg
- the message that is arriving.public boolean deliverWhenNotReady()
deliverWhenNotReady
in class PastryAppl
|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |