|
Rice Pastry API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--rice.pastry.PastryNode | +--rice.pastry.multiring.MultiRingPastryNode
Class which represents a pastry node which is in multiple rings. It internally contains a pastry node for each seperate ring, and has logic for routing messages between the nodes. Note that the pastry nodes in all of the different rings have the same NodeId.
Field Summary | |
static rice.pastry.multiring.RingId |
GLOBAL_RING_ID
|
Fields inherited from class rice.pastry.PastryNode |
apps, localhandle, myNodeId |
Constructor Summary | |
protected |
MultiRingPastryNode(rice.pastry.PastryNode primaryNode)
Which takes in the first "real" pastry node. |
Method Summary | |
void |
addChildPastryNode(rice.pastry.multiring.MultiRingPastryNode child)
|
void |
addLeafSetObserver(java.util.Observer o)
Add a leaf set observer to the Pastry node. |
void |
addRouteSetObserver(java.util.Observer o)
Add a route set observer to the Pastry node. |
void |
broadcastRingId(rice.pastry.multiring.RingId ringId)
|
void |
deleteLeafSetObserver(java.util.Observer o)
Delete a leaf set observer from the Pastry node. |
void |
deleteRouteSetObserver(java.util.Observer o)
Delete a route set observer from the Pastry node. |
rice.pastry.leafset.LeafSet |
getLeafSet()
|
rice.pastry.NodeHandle |
getLocalHandle()
|
rice.pastry.messaging.MessageDispatch |
getMessageDispatch()
FOR TESTING ONLY - DO NOT USE! |
rice.pastry.multiring.MultiRingAppl |
getMultiRingAppl()
|
rice.pastry.NodeId |
getNodeId()
|
protected rice.pastry.multiring.MultiRingPastryNode |
getParent()
|
rice.pastry.PastryNode |
getPastryNode()
|
rice.pastry.multiring.RingId |
getRingId()
|
rice.pastry.routing.RoutingTable |
getRoutingTable()
|
rice.scribe.Scribe |
getScribe()
|
void |
initiateJoin(rice.pastry.NodeHandle bootstrap)
Overridden by derived classes to initiate the join process |
boolean |
isClosest(rice.pastry.NodeId key)
Called by the layered Pastry application to check if the local pastry node is the one that is currently closest to the object key id. |
boolean |
isReady()
|
void |
nodeIsReady()
Overridden by derived classes, and invoked when the node has joined successfully. |
void |
processMessage(rice.pastry.messaging.Message msg)
|
void |
receiveMessage(rice.pastry.messaging.Message m)
message receiver interface. |
void |
registerApp(rice.pastry.client.PastryAppl app)
Registers an application with this pastry node. |
void |
registerReceiver(rice.pastry.security.Credentials cred,
rice.pastry.messaging.Address address,
rice.pastry.messaging.MessageReceiver receiver)
Registers a message receiver with this Pastry node. |
rice.pastry.ScheduledMessage |
scheduleMsg(rice.pastry.messaging.Message msg,
long delay)
Schedule the specified message to be sent to the local node after a specified delay. |
rice.pastry.ScheduledMessage |
scheduleMsg(rice.pastry.messaging.Message msg,
long delay,
long period)
Schedule the specified message for repeated fixed-delay delivery to the local node, beginning after the specified delay. |
rice.pastry.ScheduledMessage |
scheduleMsgAtFixedRate(rice.pastry.messaging.Message msg,
long delay,
long period)
Schedule the specified message for repeated fixed-rate delivery to the local node, beginning after the specified delay. |
void |
setBootstrap(rice.pastry.NodeHandle bootstrap)
|
void |
setElements(rice.pastry.NodeHandle lh,
rice.pastry.security.PastrySecurityManager sm,
rice.pastry.messaging.MessageDispatch md,
rice.pastry.leafset.LeafSet ls,
rice.pastry.routing.RoutingTable rt)
Combined accessor method for various members of PastryNode. |
void |
setMessageDispatch(rice.pastry.messaging.MessageDispatch md)
|
void |
setParentPastryNode(rice.pastry.multiring.MultiRingPastryNode parent)
|
void |
setReady()
|
java.lang.String |
toString()
|
Methods inherited from class rice.pastry.PastryNode |
getId, getIdFactory, registerApplication |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static rice.pastry.multiring.RingId GLOBAL_RING_ID
Constructor Detail |
protected MultiRingPastryNode(rice.pastry.PastryNode primaryNode)
Method Detail |
public rice.pastry.PastryNode getPastryNode()
public rice.pastry.multiring.RingId getRingId()
public rice.scribe.Scribe getScribe()
public void processMessage(rice.pastry.messaging.Message msg)
public void setBootstrap(rice.pastry.NodeHandle bootstrap)
public void setParentPastryNode(rice.pastry.multiring.MultiRingPastryNode parent)
public void addChildPastryNode(rice.pastry.multiring.MultiRingPastryNode child)
public void broadcastRingId(rice.pastry.multiring.RingId ringId)
public rice.pastry.multiring.MultiRingAppl getMultiRingAppl()
protected rice.pastry.multiring.MultiRingPastryNode getParent()
public void receiveMessage(rice.pastry.messaging.Message m)
PastryNode
receiveMessage
in interface MessageReceiver
receiveMessage
in class PastryNode
m
- the message.public rice.pastry.messaging.MessageDispatch getMessageDispatch()
PastryNode
getMessageDispatch
in class PastryNode
public void setMessageDispatch(rice.pastry.messaging.MessageDispatch md)
setMessageDispatch
in class PastryNode
public final void setElements(rice.pastry.NodeHandle lh, rice.pastry.security.PastrySecurityManager sm, rice.pastry.messaging.MessageDispatch md, rice.pastry.leafset.LeafSet ls, rice.pastry.routing.RoutingTable rt)
PastryNode
setElements
in class PastryNode
lh
- Node handle corresponding to this node.sm
- Security manager.md
- Message dispatcher.ls
- Leaf set.rt
- Routing table.public rice.pastry.NodeHandle getLocalHandle()
getLocalHandle
in class PastryNode
public rice.pastry.NodeId getNodeId()
getNodeId
in class PastryNode
public boolean isReady()
isReady
in class PastryNode
public void nodeIsReady()
PastryNode
nodeIsReady
in class PastryNode
public void setReady()
setReady
in class PastryNode
public boolean isClosest(rice.pastry.NodeId key)
PastryNode
isClosest
in class PastryNode
key
- the object key id
public rice.pastry.leafset.LeafSet getLeafSet()
getLeafSet
in class PastryNode
public rice.pastry.routing.RoutingTable getRoutingTable()
getRoutingTable
in class PastryNode
public void initiateJoin(rice.pastry.NodeHandle bootstrap)
PastryNode
initiateJoin
in class PastryNode
bootstrap
- Node handle to bootstrap with.public void addLeafSetObserver(java.util.Observer o)
PastryNode
addLeafSetObserver
in class PastryNode
o
- the observer.public void deleteLeafSetObserver(java.util.Observer o)
PastryNode
deleteLeafSetObserver
in class PastryNode
o
- the observer.public void addRouteSetObserver(java.util.Observer o)
PastryNode
addRouteSetObserver
in class PastryNode
o
- the observer.public void deleteRouteSetObserver(java.util.Observer o)
PastryNode
deleteRouteSetObserver
in class PastryNode
o
- the observer.public void registerReceiver(rice.pastry.security.Credentials cred, rice.pastry.messaging.Address address, rice.pastry.messaging.MessageReceiver receiver)
PastryNode
registerReceiver
in class PastryNode
cred
- the credentials.address
- the address that the receiver will be at.receiver
- the message receiver.public void registerApp(rice.pastry.client.PastryAppl app)
PastryNode
registerApp
in class PastryNode
app
- the applicationpublic rice.pastry.ScheduledMessage scheduleMsg(rice.pastry.messaging.Message msg, long delay)
PastryNode
scheduleMsg
in class PastryNode
msg
- a message that will be delivered to the local node after the specified delaydelay
- time in milliseconds before message is to be delivered
public rice.pastry.ScheduledMessage scheduleMsg(rice.pastry.messaging.Message msg, long delay, long period)
PastryNode
scheduleMsg
in class PastryNode
msg
- a message that will be delivered to the local node after the specified delaydelay
- time in milliseconds before message is to be deliveredperiod
- time in milliseconds between successive message deliveries
public rice.pastry.ScheduledMessage scheduleMsgAtFixedRate(rice.pastry.messaging.Message msg, long delay, long period)
PastryNode
scheduleMsgAtFixedRate
in class PastryNode
msg
- a message that will be delivered to the local node after the specified delaydelay
- time in milliseconds before message is to be deliveredperiod
- time in milliseconds between successive message deliveries
public java.lang.String toString()
toString
in class PastryNode
|
Rice Pastry API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |