|
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.testing.HelloWorldApp
A hello world example for pastry. This is the per-node app object.
Field Summary |
Fields inherited from class rice.pastry.client.PastryAppl |
address, instance, thePastryNode |
Constructor Summary | |
HelloWorldApp(rice.pastry.PastryNode pn)
|
Method Summary | |
boolean |
enrouteMessage(rice.pastry.messaging.Message msg,
rice.pastry.Id key,
rice.pastry.NodeId nextHop,
rice.pastry.routing.SendOptions opt)
Invoked on intermediate nodes in routing path. |
rice.pastry.messaging.Address |
getAddress()
Get address. |
rice.pastry.security.Credentials |
getCredentials()
Get credentials. |
void |
leafSetChange(rice.pastry.NodeHandle nh,
boolean wasAdded)
Invoked upon change to leafset. |
void |
messageForAppl(rice.pastry.messaging.Message msg)
Invoked on destination node when a message arrives. |
void |
notifyReady()
Invoked by {RMI,Direct}PastryNode when the node has something in its leaf set, and has become ready to receive application messages. |
void |
routeSetChange(rice.pastry.NodeHandle nh,
boolean wasAdded)
Invoked upon change to routing table. |
void |
sendRndMsg(java.util.Random rng)
Sends a message to a randomly chosen node. |
Methods inherited from class rice.pastry.client.PastryAppl |
getLeafSet, getNodeHandle, getNodeId, getRoutingTable, isClosest, receiveMessage, registerReceiver, routeMsg, routeMsgDirect, sendMessage |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public HelloWorldApp(rice.pastry.PastryNode pn)
Method Detail |
public void sendRndMsg(java.util.Random rng)
rng
- Random number generator.public rice.pastry.messaging.Address getAddress()
getAddress
in class PastryAppl
public rice.pastry.security.Credentials getCredentials()
getCredentials
in class PastryAppl
public void messageForAppl(rice.pastry.messaging.Message msg)
messageForAppl
in class PastryAppl
msg
- Message being routed aroundpublic boolean enrouteMessage(rice.pastry.messaging.Message msg, rice.pastry.Id key, rice.pastry.NodeId nextHop, rice.pastry.routing.SendOptions opt)
enrouteMessage
in class PastryAppl
msg
- Message that's passing through this node.key
- destinationnextHop
- next hopopt
- send options
public void leafSetChange(rice.pastry.NodeHandle nh, boolean wasAdded)
leafSetChange
in class PastryAppl
nh
- node handle that got added/removedwasAdded
- added (true) or removed (false)public void routeSetChange(rice.pastry.NodeHandle nh, boolean wasAdded)
routeSetChange
in class PastryAppl
nh
- node handle that got added/removedwasAdded
- added (true) or removed (false)public void notifyReady()
notifyReady
in class PastryAppl
|
Rice Pastry API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |