|
Project JXTA | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
A MessageSender is a MessageTransport that is able to send messages to remote peers using some protocol. MessageSenders provide facilities for:
isConnectionOriented() indicates that the MessageTransport
can provide effcient transport of a series of messages to the same
destination. {link@ #allowRouting()} indicates if the Transport should be
used in the routing of messages to destinations which are not directly
reachable via this transport.
MessageTransport,
EndpointMessenger,
EndpointService,
MessageReceiver,
NewMessage| Method Summary | |
boolean |
allowRouting()
Returns true if the endpoint protocol can be used by the EndpointRouter. |
EndpointMessenger |
getMessenger(EndpointAddress dest)
Creates an EndpointMessenger for sending messages to the
specified destination EndpointAddress. |
EndpointAddress |
getPublicAddress()
Returns the EndpointAddress which will be used as the source
address for all messages sent by this message sender. |
boolean |
isConnectionOriented()
Returns true if the endpoint protocol can establish connection to the remote host (like TCP). |
boolean |
ping(EndpointAddress addr)
Returns true if the target address is reachable via this Message Transport otherwise returns false. |
void |
propagate(NewMessage msg,
java.lang.String serviceName,
java.lang.String serviceParams,
java.lang.String prunePeer)
Propagates a Message on this EndpointProtocol. |
| Methods inherited from interface net.jxta.endpoint.MessageTransport |
equals, getProtocolName |
| Method Detail |
public EndpointAddress getPublicAddress()
EndpointAddress which will be used as the source
address for all messages sent by this message sender. This is the
"prefered" address to which replies may be sent. This address is not
necessarily the best or only address by which the peer may be reached.public boolean isConnectionOriented()
public boolean allowRouting()
public EndpointMessenger getMessenger(EndpointAddress dest)
throws java.io.IOException
EndpointMessenger for sending messages to the
specified destination EndpointAddress.
FIXME 20020709 bondolo@jxta.org This needs to be more clear about
when null is returned and when an exception is thrown. In some cases,
an IllegalArgumentException is also being thrown.dest - EndpointAddress of the destinationjava.io.IOException - when the Endpoint Transport was unable to create
an Endpoint Messenger for the given Endpoint Address.
public void propagate(NewMessage msg,
java.lang.String serviceName,
java.lang.String serviceParams,
java.lang.String prunePeer)
throws java.io.IOException
msg - the Message to be propagatedserviceName - Contains the name of the destination
service, if any. This will be integrated into the destination address.serviceParams - Contains the parameters associated with the service,
if any. This will be integrated into the destination address.prunePeer - a peer which should not receive the propagated message
or null for all peers. This is sometimes used in flooding type
algorithms to avoid sending to the peer that this received the message
from.java.io.IOException - is thrown when the message could not be propagated.public boolean ping(EndpointAddress addr)
|
Project JXTA | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||