|
Project JXTA | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | 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()
MessageTransport
,
Messenger
,
EndpointService
,
MessageReceiver
,
Message
Method Summary | |
boolean |
allowsRouting()
Returns true if the endpoint protocol can be used by the EndpointRouter. |
Messenger |
getMessenger(EndpointAddress dest,
Object hint)
Creates an Messenger 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 |
isPropagateEnabled()
Returns true if propagation is supported, and enabled. |
boolean |
isPropagationSupported()
Returns true if propagation is supported. |
boolean |
ping(EndpointAddress addr)
Returns true if the target address is reachable via this Message Transport otherwise returns false. |
void |
propagate(Message msg,
String serviceName,
String serviceParams,
String prunePeer)
Propagates a Message on this Message Transport. |
Methods inherited from interface net.jxta.endpoint.MessageTransport |
getEndpointService, getProtocolName, transportControl |
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.
The public address may also be for a different message transport.
public boolean isConnectionOriented()
public boolean allowsRouting()
public Messenger getMessenger(EndpointAddress dest, Object hint)
Messenger
for sending messages to the
specified destination EndpointAddress
.
dest
- EndpointAddress of the destinationhint
- A hint for the transport to use when creating the messenger.
public void propagate(Message msg, String serviceName, String serviceParams, String prunePeer) throws IOException
msg
- The Message to be propagated.serviceName
- 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 peer received the message from.
IOException
- is thrown when the message could not be propagated.public boolean isPropagateEnabled()
true
if propagation is supported and enabled
otherwise false
.public boolean isPropagationSupported()
true
if propagation is supported otherwise
false
.public boolean ping(EndpointAddress addr)
true
if the specified endpoint address is reachable
otherwise false
.
|
JXTA J2SE | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |