Rice Pastry API

rice.pastry
Class PastryNode

java.lang.Object
  extended by java.util.Observable
      extended by rice.pastry.PastryNode
All Implemented Interfaces:
LivenessListener<NodeHandle>, LivenessProvider<NodeHandle>, LivenessTypes, ProximityListener<NodeHandle>, ProximityProvider<NodeHandle>, TransportLayerCallback<NodeHandle,RawMessage>, Destructable, Node, NodeHandleFactory

public class PastryNode
extends java.util.Observable
implements Node, Destructable, NodeHandleFactory, LivenessProvider<NodeHandle>, ProximityProvider<NodeHandle>, ProximityListener<NodeHandle>, TransportLayerCallback<NodeHandle,RawMessage>, LivenessListener<NodeHandle>

A Pastry node is single entity in the pastry network.

Version:
$Id: PastryNode.java 4664 2009-02-23 18:06:07Z jeffh $
Author:
Andrew Ladd

Field Summary
protected  java.util.Vector apps
           
protected  Bootstrapper bootstrapper
          Call boot on this class.
static byte CONNECTION_NO_ACCEPTOR
           
static byte CONNECTION_NO_APP
           
static byte CONNECTION_OK
           
static byte CONNECTION_UNKNOWN
           
static byte CONNECTION_UNKNOWN_ERROR
          Used by AppSockets
protected  NodeHandleFactory handleFactory
          Used to deserialize NodeHandles
protected  boolean isDestroyed
           
protected  JoinProtocol joiner
          Call initiateJoin on this class.
protected  boolean joinFailed
           
protected  JoinFailedException joinFailedReason
           
protected  LeafSet leafSet
           
protected  int leafSetMaintFreq
           
protected  ScheduledMessage leafSetRoutineMaintenance
           
protected  LivenessProvider<NodeHandle> livenessProvider
           
protected  NodeHandle localhandle
           
protected  Logger logger
           
protected  Id myNodeId
           
protected  ProximityProvider<NodeHandle> proxProvider
           
protected  Router router
           
protected  RoutingTable routeSet
           
protected  int routeSetMaintFreq
           
protected  ScheduledMessage routeSetRoutineMaintenance
           
protected  TransportLayer<NodeHandle,RawMessage> tl
          The top level transport layer.
 
Fields inherited from interface org.mpisws.p2p.transport.proximity.ProximityProvider
DEFAULT_PROXIMITY
 
Fields inherited from interface org.mpisws.p2p.transport.liveness.LivenessTypes
LIVENESS_ALIVE, LIVENESS_DEAD, LIVENESS_DEAD_FOREVER, LIVENESS_SUSPECTED
 
Constructor Summary
PastryNode(Id id, Environment e)
          Constructor, with NodeId.
 
Method Summary
protected  void acceptAppSocket(int appId)
           
 Destructable addDestructable(Destructable d)
           
 void addLeafSetListener(NodeSetListener listener)
           
 void addLeafSetObserver(java.util.Observer o)
          Deprecated. use addLeafSetListener
 void addLivenessListener(LivenessListener<NodeHandle> name)
           
 void addNetworkListener(NetworkListener listener)
           
 void addNodeHandleFactoryListener(NodeHandleFactoryListener listener)
           
 void addProximityListener(ProximityListener<NodeHandle> listener)
           
 void addRouteSetListener(NodeSetListener listener)
           
 void addRouteSetObserver(java.util.Observer o)
          Deprecated. use addRouteSetListener
 void boot(java.util.Collection o2)
           
 void boot(java.lang.Object o)
           
 void broadcastChannelClosed(java.net.InetSocketAddress addr)
           
 void broadcastChannelOpened(java.net.InetSocketAddress addr, int reason)
           
 void broadcastReceivedListeners(int address, short msgType, java.net.InetSocketAddress from, int size, int wireType)
           
 void broadcastSentListeners(int address, short msgType, java.net.InetSocketAddress dest, int size, int wireType)
           
 Endpoint buildEndpoint(Application application, java.lang.String instance)
          Same as register application, but returns an unregistered Endpoint.
 boolean checkLiveness(NodeHandle i, java.util.Map<java.lang.String,java.lang.Object> options)
          Returns whether a new notification will occur.
 void clearState(NodeHandle i)
          Force layer to clear the existing state related to the Identifier.
 NodeHandle coalesce(NodeHandle newHandle)
          Needed for legacy java deserialization of NodeHanlde because we aren't given any other way to do this properly such as a protected constructor.
 SocketRequestHandle connect(NodeHandle i, AppSocketReceiver deliverSocketToMe, PastryAppl appl, int timeout)
          Called by PastryAppl to ask the transport layer to open a Socket to its counterpart on another node.
 void deleteLeafSetListener(NodeSetListener listener)
           
 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.
 void doneNode(java.util.Collection<NodeHandle> bootstrap)
          Called after the node is initialized.
 Bootstrapper getBootstrapper()
           
 ReadyStrategy getDefaultReadyStrategy()
          Simple Ready Strategy
 Environment getEnvironment()
          Returns the environment.
 NodeHandleFactory getHandleFactroy()
           
 Id getId()
          Returns the Id of this node
 IdFactory getIdFactory()
          Returns a factory for Ids specific to this node's protocol.
 LeafSet getLeafSet()
           
 int getLiveness(NodeHandle i)
           
 int getLiveness(NodeHandle i, java.util.Map<java.lang.String,java.lang.Object> options)
           
 LivenessProvider<NodeHandle> getLivenessProvider()
           
 NodeHandle getLocalHandle()
           
 NodeHandle getLocalNodeHandle()
          Returns a handle to the local node.
 MessageDispatch getMessageDispatch()
          FOR TESTING ONLY - DO NOT USE!
protected  java.lang.Iterable<NetworkListener> getNetworkListeners()
           
 void getNodeHandle(java.lang.Object o, Continuation<NodeHandle,java.lang.Exception> c)
           
 Id getNodeId()
           
 ProximityProvider<NodeHandle> getProxProvider()
           
 Router getRouter()
           
 RoutingTable getRoutingTable()
           
 TransportLayer<NodeHandle,RawMessage> getTL()
           
 java.util.Map<java.lang.String,java.lang.Object> getVars()
           
 void incomingSocket(P2PSocket<NodeHandle> s)
          Notification of a new socket.
 boolean isAlive(NodeHandle i)
           
 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()
           
 boolean joinFailed()
          Returns true if there was a fatal error Joining
 void joinFailed(JoinFailedException cje)
           
 JoinFailedException joinFailedReason()
           
 void livenessChanged(NodeHandle i, int val, java.util.Map<java.lang.String,java.lang.Object> options)
          Called when the liveness changes.
 void messageReceived(NodeHandle i, RawMessage m, java.util.Map<java.lang.String,java.lang.Object> options)
          Called when a new message is received.
 void nodeIsReady()
          Deprecated. use nodeIsReady(boolean)
 void nodeIsReady(boolean state)
          Overridden by derived classes, and invoked when the node has joined successfully.
protected  void notifyLivenessListeners(NodeHandle i, int val, java.util.Map<java.lang.String,java.lang.Object> options)
           
 void notifyReadyObservers()
           
 java.lang.String printRouteState()
          For debugging: print the internal routing state of the Node.
 void process(Executable task, Continuation command)
          Schedules a job for processing on the dedicated processing thread, should one exist.
 int proximity(NodeHandle nh)
          The proximity of the node handle.
 int proximity(NodeHandle nh, java.util.Map<java.lang.String,java.lang.Object> options)
           
 void proximityChanged(NodeHandle handle, int val, java.util.Map<java.lang.String,java.lang.Object> options)
           
 NodeHandle readNodeHandle(InputBuffer buf)
           
 void receiveMessage(Message msg)
          message receiver interface.
 void registerApp(PastryAppl app)
          Registers an application with this pastry node.
 Endpoint registerApplication(Application application, java.lang.String instance)
          Deprecated. use buildEndpoint() endpoint.register()
 void registerReceiver(int address, PastryAppl receiver)
          Registers a message receiver with this Pastry node.
 boolean removeDestructable(Destructable d)
           
 boolean removeLivenessListener(LivenessListener<NodeHandle> name)
           
 void removeNetworkListener(NetworkListener listener)
           
 void removeNodeHandleFactoryListener(NodeHandleFactoryListener listener)
           
 boolean removeProximityListener(ProximityListener<NodeHandle> listener)
           
 void removeRouteSetListener(NodeSetListener listener)
           
 ScheduledMessage scheduleMsg(Message msg, long delay)
          Schedule the specified message to be sent to the local node after a specified delay.
 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.
 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.
 PMessageReceipt send(NodeHandle handle, Message msg, PMessageNotification deliverAckToMe, java.util.Map<java.lang.String,java.lang.Object> tempOptions)
          Deliver message to the NodeHandle.
 void setElements(NodeHandle lh, MessageDispatch md, LeafSet ls, RoutingTable rt, Router router)
          Combined accessor method for various members of PastryNode.
 void setJoinProtocols(Bootstrapper boot, JoinProtocol joinP, LeafSetProtocol leafsetP, RouteSetProtocol routeP)
           
 void setMessageDispatch(MessageDispatch md)
           
 void setNodeHandleFetcher(NodeHandleFetcher nodeHandleFetcher)
           
 void setReady()
          Overridden by derived classes to initiate the join process
 void setReady(boolean ready)
           
 void setReadyStrategy(ReadyStrategy rs)
           
 void setSocketElements(int lsmf, int rsmf, TransportLayer<NodeHandle,RawMessage> tl, LivenessProvider<NodeHandle> livenessProvider, ProximityProvider<NodeHandle> proxProvider, NodeHandleFactory handleFactory)
           
 java.lang.String toString()
           
 
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
 

Field Detail

CONNECTION_UNKNOWN_ERROR

public static final byte CONNECTION_UNKNOWN_ERROR
Used by AppSockets

See Also:
Constant Field Values

CONNECTION_UNKNOWN

public static final byte CONNECTION_UNKNOWN
See Also:
Constant Field Values

CONNECTION_OK

public static final byte CONNECTION_OK
See Also:
Constant Field Values

CONNECTION_NO_APP

public static final byte CONNECTION_NO_APP
See Also:
Constant Field Values

CONNECTION_NO_ACCEPTOR

public static final byte CONNECTION_NO_ACCEPTOR
See Also:
Constant Field Values

myNodeId

protected Id myNodeId

leafSet

protected LeafSet leafSet

routeSet

protected RoutingTable routeSet

localhandle

protected NodeHandle localhandle

apps

protected java.util.Vector apps

logger

protected Logger logger

joinFailed

protected boolean joinFailed

isDestroyed

protected boolean isDestroyed

router

protected Router router

handleFactory

protected NodeHandleFactory handleFactory
Used to deserialize NodeHandles


joiner

protected JoinProtocol joiner
Call initiateJoin on this class.


bootstrapper

protected Bootstrapper bootstrapper
Call boot on this class.


tl

protected TransportLayer<NodeHandle,RawMessage> tl
The top level transport layer.


proxProvider

protected ProximityProvider<NodeHandle> proxProvider

joinFailedReason

protected JoinFailedException joinFailedReason

leafSetMaintFreq

protected int leafSetMaintFreq

routeSetMaintFreq

protected int routeSetMaintFreq

leafSetRoutineMaintenance

protected ScheduledMessage leafSetRoutineMaintenance

routeSetRoutineMaintenance

protected ScheduledMessage routeSetRoutineMaintenance

livenessProvider

protected LivenessProvider<NodeHandle> livenessProvider
Constructor Detail

PastryNode

public PastryNode(Id id,
                  Environment e)
Constructor, with NodeId. Need to set the node's ID before this node is inserted as localHandle.localNode.

Method Detail

boot

public void boot(java.lang.Object o)

boot

public void boot(java.util.Collection o2)

getDefaultReadyStrategy

public ReadyStrategy getDefaultReadyStrategy()
Simple Ready Strategy


setReadyStrategy

public void setReadyStrategy(ReadyStrategy rs)

setElements

public void setElements(NodeHandle lh,
                        MessageDispatch md,
                        LeafSet ls,
                        RoutingTable rt,
                        Router router)
Combined accessor method for various members of PastryNode. These are generated by node factories, and assigned here. Other elements specific to the wire protocol are assigned via methods set{RMI,Direct}Elements in the respective derived classes.

Parameters:
lh - Node handle corresponding to this node.
sm - Security manager.
md - Message dispatcher.
ls - Leaf set.
rt - Routing table.

setJoinProtocols

public void setJoinProtocols(Bootstrapper boot,
                             JoinProtocol joinP,
                             LeafSetProtocol leafsetP,
                             RouteSetProtocol routeP)

getLocalNodeHandle

public NodeHandle getLocalNodeHandle()
Description copied from interface: Node
Returns a handle to the local node. This node handle is serializable, and can therefore be sent to other nodes in the network and still be valid.

Specified by:
getLocalNodeHandle in interface Node
Returns:
A NodeHandle referring to the local node.

getEnvironment

public Environment getEnvironment()
Description copied from interface: Node
Returns the environment. This allows the nodes to be virtualized within the JVM

Specified by:
getEnvironment in interface Node
Returns:
the environment for this node/app.

getLocalHandle

public NodeHandle getLocalHandle()

getNodeId

public Id getNodeId()

isReady

public boolean isReady()

getMessageDispatch

public MessageDispatch getMessageDispatch()
FOR TESTING ONLY - DO NOT USE!


setMessageDispatch

public void setMessageDispatch(MessageDispatch md)

addDestructable

public Destructable addDestructable(Destructable d)

removeDestructable

public boolean removeDestructable(Destructable d)

nodeIsReady

public void nodeIsReady(boolean state)
Overridden by derived classes, and invoked when the node has joined successfully. This should probably be abstract, but maybe in a later version.

Parameters:
state - true when the node is ready, false when not

setReady

public void setReady()
Overridden by derived classes to initiate the join process

Parameters:
bootstrap - Node handle to bootstrap with.

setReady

public void setReady(boolean ready)

coalesce

public NodeHandle coalesce(NodeHandle newHandle)
Description copied from interface: NodeHandleFactory
Needed for legacy java deserialization of NodeHanlde because we aren't given any other way to do this properly such as a protected constructor.

Specified by:
coalesce in interface NodeHandleFactory
Returns:

notifyReadyObservers

public void notifyReadyObservers()

isClosest

public 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.

Parameters:
key - the object key id
Returns:
true if the local node is currently the closest to the key.

getLeafSet

public LeafSet getLeafSet()

getRoutingTable

public RoutingTable getRoutingTable()

addLeafSetObserver

public void addLeafSetObserver(java.util.Observer o)
Deprecated. use addLeafSetListener

Add a leaf set observer to the Pastry node.

Parameters:
o - the observer.

deleteLeafSetObserver

public void deleteLeafSetObserver(java.util.Observer o)
Deprecated. use deleteLeafSetListener

Delete a leaf set observer from the Pastry node.

Parameters:
o - the observer.

addLeafSetListener

public void addLeafSetListener(NodeSetListener listener)

deleteLeafSetListener

public void deleteLeafSetListener(NodeSetListener listener)

addRouteSetObserver

public void addRouteSetObserver(java.util.Observer o)
Deprecated. use addRouteSetListener

Add a route set observer to the Pastry node.

Parameters:
o - the observer.

deleteRouteSetObserver

public void deleteRouteSetObserver(java.util.Observer o)
Deprecated. use deleteRouteSetListener

Delete a route set observer from the Pastry node.

Parameters:
o - the observer.

addRouteSetListener

public void addRouteSetListener(NodeSetListener listener)

removeRouteSetListener

public void removeRouteSetListener(NodeSetListener listener)

receiveMessage

public void receiveMessage(Message msg)
message receiver interface. synchronized so that the external message processing thread and the leafset/route maintenance thread won't interfere with application messages.


registerReceiver

public void registerReceiver(int address,
                             PastryAppl receiver)
Registers a message receiver with this Pastry node.

Parameters:
cred - the credentials.
address - the address that the receiver will be at.
receiver - the message receiver.

registerApp

public void registerApp(PastryAppl app)
Registers an application with this pastry node.

Parameters:
app - the application

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

registerApplication

public Endpoint registerApplication(Application application,
                                    java.lang.String instance)
Deprecated. use buildEndpoint() endpoint.register()

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.

Specified by:
registerApplication in interface Node
Parameters:
application - The Application
instance - An identifier for a given instance
Returns:
The endpoint specific to this applicationk, which can be used for message sending/receiving.

buildEndpoint

public Endpoint buildEndpoint(Application application,
                              java.lang.String instance)
Description copied from interface: Node
Same as register application, but returns an unregistered Endpoint. This allows the application to finish initialization that may require the endpoint before it receives messages from the network and notification of changes. When then application is ready, it must call endpoint.register() to receive messages.

Specified by:
buildEndpoint in interface Node
Returns:

getId

public Id getId()
Returns the Id of this node

Specified by:
getId in interface Node
Returns:
This node's Id

getIdFactory

public IdFactory getIdFactory()
Returns a factory for Ids specific to this node's protocol.

Specified by:
getIdFactory in interface Node
Returns:
A factory for creating Ids.

process

public void process(Executable task,
                    Continuation command)
Schedules a job for processing on the dedicated processing thread, should one exist. CPU intensive jobs, such as encryption, erasure encoding, or bloom filter creation should never be done in the context of the underlying node's thread, and should only be done via this method.

Parameters:
task - The task to run on the processing thread
command - The command to return the result to once it's done

destroy

public void destroy()
Method which kills a PastryNode. Note, this doesn't implicitly kill the environment. Make sure to call super.destroy() !!!

Specified by:
destroy in interface Destructable

connect

public SocketRequestHandle connect(NodeHandle i,
                                   AppSocketReceiver deliverSocketToMe,
                                   PastryAppl appl,
                                   int timeout)
Called by PastryAppl to ask the transport layer to open a Socket to its counterpart on another node.

Parameters:
handle -
receiver -
appl -

joinFailed

public void joinFailed(JoinFailedException cje)

joinFailed

public boolean joinFailed()
Returns true if there was a fatal error Joining

Returns:

joinFailedReason

public JoinFailedException joinFailedReason()

getRouter

public Router getRouter()

printRouteState

public java.lang.String printRouteState()
Description copied from interface: Node
For debugging: print the internal routing state of the Node.

Specified by:
printRouteState in interface Node
Returns:

setSocketElements

public void setSocketElements(int lsmf,
                              int rsmf,
                              TransportLayer<NodeHandle,RawMessage> tl,
                              LivenessProvider<NodeHandle> livenessProvider,
                              ProximityProvider<NodeHandle> proxProvider,
                              NodeHandleFactory handleFactory)

getVars

public java.util.Map<java.lang.String,java.lang.Object> getVars()

incomingSocket

public void incomingSocket(P2PSocket<NodeHandle> s)
                    throws java.io.IOException
Description copied from interface: TransportLayerCallback
Notification of a new socket.

Specified by:
incomingSocket in interface TransportLayerCallback<NodeHandle,RawMessage>
Parameters:
s - the incoming socket
Throws:
java.io.IOException

acceptAppSocket

protected void acceptAppSocket(int appId)
                        throws AppSocketException
Throws:
AppSocketException

proximity

public int proximity(NodeHandle nh)
The proximity of the node handle.

Parameters:
nh -
Returns:

proximity

public int proximity(NodeHandle nh,
                     java.util.Map<java.lang.String,java.lang.Object> options)
Specified by:
proximity in interface ProximityProvider<NodeHandle>

scheduleMsg

public ScheduledMessage scheduleMsg(Message msg,
                                    long delay)
Schedule the specified message to be sent to the local node after a specified delay. Useful to provide timeouts.

Parameters:
msg - a message that will be delivered to the local node after the specified delay
delay - time in milliseconds before message is to be delivered
Returns:
the scheduled event object; can be used to cancel the message

scheduleMsg

public 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. Subsequent executions take place at approximately regular intervals separated by the specified period. Useful to initiate periodic tasks.

Parameters:
msg - a message that will be delivered to the local node after the specified delay
delay - time in milliseconds before message is to be delivered
period - time in milliseconds between successive message deliveries
Returns:
the scheduled event object; can be used to cancel the message

scheduleMsgAtFixedRate

public 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. Subsequent executions take place at approximately regular intervals, separated by the specified period.

Parameters:
msg - a message that will be delivered to the local node after the specified delay
delay - time in milliseconds before message is to be delivered
period - time in milliseconds between successive message deliveries
Returns:
the scheduled event object; can be used to cancel the message

send

public PMessageReceipt send(NodeHandle handle,
                            Message msg,
                            PMessageNotification deliverAckToMe,
                            java.util.Map<java.lang.String,java.lang.Object> tempOptions)
Deliver message to the NodeHandle.

Parameters:
nh -
m -
Returns:

messageReceived

public void messageReceived(NodeHandle i,
                            RawMessage m,
                            java.util.Map<java.lang.String,java.lang.Object> options)
                     throws java.io.IOException
Description copied from interface: TransportLayerCallback
Called when a new message is received.

Specified by:
messageReceived in interface TransportLayerCallback<NodeHandle,RawMessage>
Parameters:
i - The node it is coming from
m - the message
options - describe how the message arrived (udp/tcp, encrypted etc)
Throws:
java.io.IOException - if there is a problem decoding the message

readNodeHandle

public NodeHandle readNodeHandle(InputBuffer buf)
                          throws java.io.IOException
Specified by:
readNodeHandle in interface NodeHandleFactory
Throws:
java.io.IOException

getBootstrapper

public Bootstrapper getBootstrapper()

doneNode

public void doneNode(java.util.Collection<NodeHandle> bootstrap)
Called after the node is initialized.

Parameters:
bootstrap - The node which this node should boot off of.

livenessChanged

public void livenessChanged(NodeHandle i,
                            int val,
                            java.util.Map<java.lang.String,java.lang.Object> options)
Description copied from interface: LivenessListener
Called when the liveness changes.

Specified by:
livenessChanged in interface LivenessListener<NodeHandle>

addLivenessListener

public void addLivenessListener(LivenessListener<NodeHandle> name)
Specified by:
addLivenessListener in interface LivenessProvider<NodeHandle>

removeLivenessListener

public boolean removeLivenessListener(LivenessListener<NodeHandle> name)
Specified by:
removeLivenessListener in interface LivenessProvider<NodeHandle>

notifyLivenessListeners

protected void notifyLivenessListeners(NodeHandle i,
                                       int val,
                                       java.util.Map<java.lang.String,java.lang.Object> options)

checkLiveness

public boolean checkLiveness(NodeHandle i,
                             java.util.Map<java.lang.String,java.lang.Object> options)
Description copied from interface: LivenessProvider
Returns whether a new notification will occur. Will return false if a liveness check has recently completed. Will return true if a new liveness check starts, or an existing one is in progress.

Specified by:
checkLiveness in interface LivenessProvider<NodeHandle>
Parameters:
i - the node to check
Returns:
true if there will be an update (either a ping, or a change in liveness) false if there won't be an update due to bandwidth concerns

getLiveness

public int getLiveness(NodeHandle i,
                       java.util.Map<java.lang.String,java.lang.Object> options)
Specified by:
getLiveness in interface LivenessProvider<NodeHandle>

getLiveness

public int getLiveness(NodeHandle i)

isAlive

public boolean isAlive(NodeHandle i)

proximityChanged

public void proximityChanged(NodeHandle handle,
                             int val,
                             java.util.Map<java.lang.String,java.lang.Object> options)
Specified by:
proximityChanged in interface ProximityListener<NodeHandle>

getLivenessProvider

public LivenessProvider<NodeHandle> getLivenessProvider()

getProxProvider

public ProximityProvider<NodeHandle> getProxProvider()

getTL

public TransportLayer<NodeHandle,RawMessage> getTL()

clearState

public void clearState(NodeHandle i)
Description copied from interface: LivenessProvider
Force layer to clear the existing state related to the Identifier. Usually if there is reason to believe a node has returned.

Specified by:
clearState in interface LivenessProvider<NodeHandle>
Specified by:
clearState in interface ProximityProvider<NodeHandle>

addProximityListener

public void addProximityListener(ProximityListener<NodeHandle> listener)
Specified by:
addProximityListener in interface ProximityProvider<NodeHandle>

removeProximityListener

public boolean removeProximityListener(ProximityListener<NodeHandle> listener)
Specified by:
removeProximityListener in interface ProximityProvider<NodeHandle>

nodeIsReady

public void nodeIsReady()
Deprecated. use nodeIsReady(boolean)

Overridden by derived classes, and invoked when the node has joined successfully. This one is for backwards compatability. It will soon be deprecated.


getHandleFactroy

public NodeHandleFactory getHandleFactroy()

addNetworkListener

public void addNetworkListener(NetworkListener listener)

removeNetworkListener

public void removeNetworkListener(NetworkListener listener)

getNetworkListeners

protected java.lang.Iterable<NetworkListener> getNetworkListeners()

broadcastChannelClosed

public void broadcastChannelClosed(java.net.InetSocketAddress addr)

broadcastChannelOpened

public void broadcastChannelOpened(java.net.InetSocketAddress addr,
                                   int reason)

broadcastSentListeners

public void broadcastSentListeners(int address,
                                   short msgType,
                                   java.net.InetSocketAddress dest,
                                   int size,
                                   int wireType)

broadcastReceivedListeners

public void broadcastReceivedListeners(int address,
                                       short msgType,
                                       java.net.InetSocketAddress from,
                                       int size,
                                       int wireType)

addNodeHandleFactoryListener

public void addNodeHandleFactoryListener(NodeHandleFactoryListener listener)
Specified by:
addNodeHandleFactoryListener in interface NodeHandleFactory

removeNodeHandleFactoryListener

public void removeNodeHandleFactoryListener(NodeHandleFactoryListener listener)
Specified by:
removeNodeHandleFactoryListener in interface NodeHandleFactory

setNodeHandleFetcher

public void setNodeHandleFetcher(NodeHandleFetcher nodeHandleFetcher)

getNodeHandle

public void getNodeHandle(java.lang.Object o,
                          Continuation<NodeHandle,java.lang.Exception> c)

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection