|
Project JXTA | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.jxta.impl.rendezvous.RendezVousServiceProvider
net.jxta.impl.rendezvous.StdRendezVousService
Base class for providers which implement the JXTA Standard Rendezvous Protocol.
Nested Class Summary | |
protected static interface |
StdRendezVousService.StdRdvProtocolListener
Interface for listeners to : |
Field Summary | |
static String |
ConnectedLeaseReply
|
static String |
ConnectedPeerReply
|
static String |
ConnectedRdvAdvReply
|
static String |
ConnectRequest
|
protected static int |
DEFAULT_MAX_TTL
Default Maximum TTL. |
static String |
DisconnectRequest
|
protected String |
pName
|
protected String |
pParam
|
static String |
RdvAdvReply
|
protected Timer |
timer
|
Fields inherited from class net.jxta.impl.rendezvous.RendezVousServiceProvider |
closed, group, HEADER_NAME, MAX_TTL, MESSAGE_NAMESPACE_NAME, PropPName, PropSName, rdvService, rendezvousMeter, rendezvousServiceMonitor |
Constructor Summary | |
protected |
StdRendezVousService(PeerGroup group,
RendezVousServiceImpl rdvService)
Constructor |
Method Summary | |
abstract PeerConnection |
getPeerConnection(ID id)
Returns the peer connection or null if not present. |
protected abstract PeerConnection[] |
getPeerConnections()
Returns a list of the current peer connections. |
protected void |
processRdvAdvReply(Message msg)
Receive and publish a Rendezvous Peer Advertisement. |
void |
processReceivedMessage(Message message,
RendezVousPropagateMessage propHdr,
EndpointAddress srcAddr,
EndpointAddress dstAddr)
Process a propagated message. |
void |
propagate(Enumeration destPeerIDs,
Message msg,
String serviceName,
String serviceParam,
int ttl)
Propagates a message onto as many peers on the local network as possible. |
void |
propagateToNeighbors(Message msg,
String serviceName,
String serviceParam,
int ttl)
Propagates a message onto as many peers on the local network as possible. Typically the message will go to all the peers to which at least one endpoint transport can address without using the router. Only a single HOP at a time is performed. Messages are always delivered to the destination handler on arrival. This handler is responsible for repropagating further, if deemed appropropriate. Loop and TTL control are performed automatically. Messages can be propagated via this method for the first time or can be re-propagated by re-using a message that came in via propagation. In the later case, the TTL and loop detection parameters CANNOT be re-initialized. If one wants to "re-propagate" a message with a new TTL and blank gateways list one must generate a completely new message. This limits the risk of accidental propagation storms, although they can always be engineered deliberately. Note: The original msg is not modified and may be reused upon return. |
protected void |
sendDisconnect(PeerConnection pConn)
Sends a disconnect message to the specified peer. |
protected void |
sendDisconnect(PeerID peerid,
PeerAdvertisement padv)
Sends a disconnect message to the specified peer. |
protected int |
sendToEachConnection(Message msg,
RendezVousPropagateMessage propHdr)
Sends to all connected peers. |
protected int |
startApp(String[] argv,
StdRendezVousService.StdRdvProtocolListener handler)
|
protected void |
stopApp()
Ask this service to stop. |
Methods inherited from class net.jxta.impl.rendezvous.RendezVousServiceProvider |
challengeRendezVous, checkPropHeader, disconnectFromRendezVous, getConnectedPeerIDs, getConnectedPeers, getConnectedRendezVous, getDisconnectedRendezVous, getPeerAdvertisementDoc, getPropHeader, isConnectedToRendezVous, mkAddress, mkAddress, processIncomingMessage, propagate, propagateInGroup, repropagate, sendToNetwork, setChoiceDelay, setRendezvousServiceMonitor, startApp, updatePropHeader, walk, walk |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String ConnectRequest
public static final String DisconnectRequest
public static final String ConnectedPeerReply
public static final String ConnectedLeaseReply
public static final String ConnectedRdvAdvReply
public static final String RdvAdvReply
protected static final int DEFAULT_MAX_TTL
protected final String pName
protected final String pParam
protected final Timer timer
Constructor Detail |
protected StdRendezVousService(PeerGroup group, RendezVousServiceImpl rdvService)
Method Detail |
protected int startApp(String[] argv, StdRendezVousService.StdRdvProtocolListener handler)
protected void stopApp()
RendezVousServiceProvider
stopApp
in class RendezVousServiceProvider
protected void processRdvAdvReply(Message msg)
msg
- Message containing the Rendezvous Peer Advertisementpublic void processReceivedMessage(Message message, RendezVousPropagateMessage propHdr, EndpointAddress srcAddr, EndpointAddress dstAddr)
processReceivedMessage
in class RendezVousServiceProvider
public void propagate(Enumeration destPeerIDs, Message msg, String serviceName, String serviceParam, int ttl)
RendezVousServiceProvider
propagate
in class RendezVousServiceProvider
msg
- is the message to propagate.serviceName
- is the name of the serviceserviceParam
- is the parameter of the servicepublic void propagateToNeighbors(Message msg, String serviceName, String serviceParam, int ttl) throws IOException
propagateToNeighbors
in class RendezVousServiceProvider
msg
- is the message to propagate.serviceName
- is the name of the serviceserviceParam
- is the parameter of the service
IOException
public abstract PeerConnection getPeerConnection(ID id)
protected abstract PeerConnection[] getPeerConnections()
protected int sendToEachConnection(Message msg, RendezVousPropagateMessage propHdr)
msg
- is the message to propagate.protected void sendDisconnect(PeerID peerid, PeerAdvertisement padv)
protected void sendDisconnect(PeerConnection pConn)
|
JXTA J2SE | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |