JXTA

net.jxta.impl.rendezvous.limited
Class LimitedRangeWalker

java.lang.Object
  extended by net.jxta.impl.rendezvous.limited.LimitedRangeWalker
All Implemented Interfaces:
RdvWalker

public class LimitedRangeWalker
extends Object
implements RdvWalker

The Limited Range Walker is designed to be used by Rendezvous Peer in order to propagate a message amongst them. A target destination peer is used in order to send the message to a primary peer. Then, depending on the TTL, the message is duplicated into two messages, each of them being sent in opposite "directions" of the RPV.


Constructor Summary
LimitedRangeWalker(LimitedRangeWalk walk)
          Constructor
 
Method Summary
 void stop()
          Stop the walker.
 void walkMessage(PeerID destination, Message msg, String srcSvcName, String srcSvcParam, int ttl)
          Walk a message to other Rendezvous peers participating into the walk.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LimitedRangeWalker

public LimitedRangeWalker(LimitedRangeWalk walk)
Constructor

Parameters:
walk - The walk we will be associated with.
Method Detail

stop

public void stop()
Stop the walker. Some walkers may implement a strategy that has state and this method will stop any internal processing.

Specified by:
stop in interface RdvWalker

walkMessage

public void walkMessage(PeerID destination,
                        Message msg,
                        String srcSvcName,
                        String srcSvcParam,
                        int ttl)
                 throws IOException
Walk a message to other Rendezvous peers participating into the walk. An initial rendezvous peer can be optionally provided as a hint.

Specified by:
walkMessage in interface RdvWalker
Parameters:
destination - An optional PeerID of the peer which will be the initial recipient of the walked message.
msg - The message to walk. The message will be modified.
srcSvcName - The name of the service.
srcSvcParam - The parameter of the service.
ttl - The maximum TTL of the message. This value may be decreased by the Walker implementation, but will never be increased.
Throws:
IOException - If the message was not sent to any other rendezvous peers.

JXSE