|
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.pastry.PastryNode
public abstract class PastryNode
A Pastry node is single entity in the pastry network.
Field Summary | |
---|---|
protected java.util.Vector |
apps
DESCRIBE THE FIELD |
protected boolean |
joinFailed
DESCRIBE THE FIELD |
protected LeafSet |
leafSet
DESCRIBE THE FIELD |
protected NodeHandle |
localhandle
DESCRIBE THE FIELD |
protected Logger |
logger
DESCRIBE THE FIELD |
protected Id |
myNodeId
DESCRIBE THE FIELD |
protected RoutingTable |
routeSet
DESCRIBE THE FIELD |
Constructor Summary | |
---|---|
protected |
PastryNode(Id id,
Environment e)
Constructor, with NodeId. |
Method Summary | |
---|---|
Destructable |
addDestructable(Destructable d)
Adds a feature to the Destructable attribute of the PastryNode object |
void |
addLeafSetListener(NodeSetListener listener)
Adds the specified LeafSet listener to receive LeafSet events from this component. |
void |
addLeafSetObserver(java.util.Observer o)
Deprecated. use addLeafSetListener |
void |
addRouteSetListener(NodeSetListener listener)
Adds the specified RouteSet listener to receive RouteSet events from this component. |
void |
addRouteSetObserver(java.util.Observer o)
Deprecated. use addRouteSetListener |
Endpoint |
buildEndpoint(Application application,
java.lang.String instance)
DESCRIBE THE METHOD |
abstract NodeHandle |
coalesce(NodeHandle newHandle)
DESCRIBE THE METHOD |
abstract void |
connect(NodeHandle handle,
AppSocketReceiver receiver,
PastryAppl appl,
int timeout)
DESCRIBE THE METHOD |
void |
deleteLeafSetListener(NodeSetListener listener)
DESCRIBE THE METHOD |
void |
deleteLeafSetObserver(java.util.Observer o)
Deprecated. use deleteLeafSetListener |
void |
deleteRouteSetObserver(java.util.Observer o)
Deprecated. use deleteRouteSetListener |
void |
destroy()
Method which kills a PastryNode. |
Environment |
getEnvironment()
Gets the Environment attribute of the PastryNode object |
Id |
getId()
Returns the Id of this node |
IdFactory |
getIdFactory()
Returns a factory for Ids specific to this node's protocol. |
LeafSet |
getLeafSet()
Gets the LeafSet attribute of the PastryNode object |
NodeHandle |
getLocalHandle()
Gets the LocalHandle attribute of the PastryNode object |
NodeHandle |
getLocalNodeHandle()
Gets the LocalNodeHandle attribute of the PastryNode object |
MessageDispatch |
getMessageDispatch()
FOR TESTING ONLY - DO NOT USE! |
Id |
getNodeId()
Gets the NodeId attribute of the PastryNode object |
RoutingTable |
getRoutingTable()
Gets the RoutingTable attribute of the PastryNode object |
abstract void |
initiateJoin(NodeHandle[] bootstrap)
Overridden by derived classes to initiate the join process |
boolean |
isClosest(Id 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()
Gets the Ready attribute of the PastryNode object |
boolean |
joinFailed()
Returns true if there was a fatal error Joining |
void |
joinFailed(JoinFailedException cje)
DESCRIBE THE METHOD |
abstract void |
nodeIsReady()
Overridden by derived classes, and invoked when the node has joined successfully. |
void |
nodeIsReady(boolean state)
Overridden by derived classes, and invoked when the node has joined successfully. |
void |
notifyReadyObservers()
DESCRIBE THE METHOD |
void |
process(Executable task,
Continuation command)
Schedules a job for processing on the dedicated processing thread, should one exist. |
abstract int |
proximity(NodeHandle nh)
DESCRIBE THE METHOD |
void |
receiveMessage(Message msg)
message receiver interface. |
void |
receiveMessage(RawMessageDelivery delivery)
DESCRIBE THE METHOD |
void |
registerApp(PastryAppl app)
Registers an application with this pastry node. |
Endpoint |
registerApplication(Application application,
java.lang.String instance)
This returns a VirtualizedNode specific to the given application and instance name to the application, which the application can then use in order to send an receive messages. |
void |
registerReceiver(int address,
PastryAppl receiver)
Registers a message receiver with this Pastry node. |
boolean |
removeDestructable(Destructable d)
DESCRIBE THE METHOD |
void |
removeRouteSetListener(NodeSetListener listener)
Removes the specified RouteSet listener so that it no longer receives RouteSet events from this component. |
abstract ScheduledMessage |
scheduleMsg(Message msg,
long delay)
Schedule the specified message to be sent to the local node after a specified delay. |
abstract ScheduledMessage |
scheduleMsg(Message msg,
long delay,
long period)
Schedule the specified message for repeated fixed-delay delivery to the local node, beginning after the specified delay. |
abstract ScheduledMessage |
scheduleMsgAtFixedRate(Message msg,
long delay,
long period)
Schedule the specified message for repeated fixed-rate delivery to the local node, beginning after the specified delay. |
abstract void |
send(NodeHandle handle,
Message message)
DESCRIBE THE METHOD |
void |
setElements(NodeHandle lh,
MessageDispatch md,
LeafSet ls,
RoutingTable rt)
Combined accessor method for various members of PastryNode. |
void |
setMessageDispatch(MessageDispatch md)
Sets the MessageDispatch attribute of the PastryNode object |
void |
setReady()
Sets the Ready attribute of the PastryNode object |
void |
setReady(boolean ready)
Sets the Ready attribute of the PastryNode object |
void |
setReadyStrategy(ReadyStrategy rs)
Sets the ReadyStrategy attribute of the PastryNode object |
java.lang.String |
toString()
Converts to a String representation of the object. |
Methods inherited from class java.util.Observable |
---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface rice.pastry.NodeHandleFactory |
---|
readNodeHandle |
Field Detail |
---|
protected Id myNodeId
protected LeafSet leafSet
protected RoutingTable routeSet
protected NodeHandle localhandle
protected java.util.Vector apps
protected Logger logger
protected boolean joinFailed
Constructor Detail |
---|
protected PastryNode(Id id, Environment e)
id
- DESCRIBE THE PARAMETERe
- DESCRIBE THE PARAMETERMethod Detail |
---|
public NodeHandle getLocalNodeHandle()
getLocalNodeHandle
in interface Node
public Environment getEnvironment()
getEnvironment
in interface Node
public NodeHandle getLocalHandle()
public Id getNodeId()
public boolean isReady()
public MessageDispatch getMessageDispatch()
public boolean isClosest(Id key)
key
- the object key id
public LeafSet getLeafSet()
public RoutingTable getRoutingTable()
public Id getId()
getId
in interface Node
public IdFactory getIdFactory()
getIdFactory
in interface Node
public void setReadyStrategy(ReadyStrategy rs)
rs
- The new ReadyStrategy valuepublic void setElements(NodeHandle lh, MessageDispatch md, LeafSet ls, RoutingTable rt)
lh
- Node handle corresponding to this node.md
- Message dispatcher.ls
- Leaf set.rt
- Routing table.public void setMessageDispatch(MessageDispatch md)
md
- The new MessageDispatch valuepublic void setReady()
public void setReady(boolean ready)
ready
- The new Ready valuepublic abstract NodeHandle coalesce(NodeHandle newHandle)
newHandle
- DESCRIBE THE PARAMETER
public Destructable addDestructable(Destructable d)
d
- The feature to be added to the Destructable attribute
public boolean removeDestructable(Destructable d)
d
- DESCRIBE THE PARAMETER
public abstract void nodeIsReady()
public void nodeIsReady(boolean state)
state
- true when the node is ready, false when notpublic abstract void initiateJoin(NodeHandle[] bootstrap)
bootstrap
- Node handle to bootstrap with.public void notifyReadyObservers()
public void addLeafSetObserver(java.util.Observer o)
o
- the observer.public void deleteLeafSetObserver(java.util.Observer o)
o
- the observer.public void addLeafSetListener(NodeSetListener listener)
listener
- Contains the LeafSetListener for LeafSetEvent data.public void deleteLeafSetListener(NodeSetListener listener)
listener
- DESCRIBE THE PARAMETERpublic void addRouteSetObserver(java.util.Observer o)
o
- the observer.public void deleteRouteSetObserver(java.util.Observer o)
o
- the observer.public void addRouteSetListener(NodeSetListener listener)
listener
- Contains the RouteSetListener for RouteSetEvent data.public void removeRouteSetListener(NodeSetListener listener)
listener
- Contains the RouteSetListener for RouteSetEvent data.public void receiveMessage(Message msg)
msg
- DESCRIBE THE PARAMETERpublic void receiveMessage(RawMessageDelivery delivery)
delivery
- DESCRIBE THE PARAMETERpublic void registerReceiver(int address, PastryAppl receiver)
address
- the address that the receiver will be at.receiver
- the message receiver.public void registerApp(PastryAppl app)
app
- the applicationpublic abstract ScheduledMessage scheduleMsg(Message msg, long delay)
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 abstract ScheduledMessage scheduleMsg(Message msg, long delay, long period)
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 abstract ScheduledMessage scheduleMsgAtFixedRate(Message msg, long delay, long period)
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 java.lang.Object
public Endpoint registerApplication(Application application, java.lang.String instance)
registerApplication
in interface Node
application
- The Applicationinstance
- An identifier for a given instance
public Endpoint buildEndpoint(Application application, java.lang.String instance)
buildEndpoint
in interface Node
application
- DESCRIBE THE PARAMETERinstance
- DESCRIBE THE PARAMETER
public void process(Executable task, Continuation command)
task
- The task to run on the processing threadcommand
- The command to return the result to once it's donepublic void destroy()
destroy
in interface Destructable
public abstract void send(NodeHandle handle, Message message)
handle
- DESCRIBE THE PARAMETERmessage
- DESCRIBE THE PARAMETERpublic abstract void connect(NodeHandle handle, AppSocketReceiver receiver, PastryAppl appl, int timeout)
handle
- DESCRIBE THE PARAMETERreceiver
- DESCRIBE THE PARAMETERappl
- DESCRIBE THE PARAMETERtimeout
- DESCRIBE THE PARAMETERpublic abstract int proximity(NodeHandle nh)
nh
- DESCRIBE THE PARAMETER
public void joinFailed(JoinFailedException cje)
cje
- DESCRIBE THE PARAMETERpublic boolean joinFailed()
|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |