Project JXTA

net.jxta.endpoint
Interface EndpointMessenger


public interface EndpointMessenger

An Endpoint Messenger is responsible for sending messages to an Endpoint Address.

Since:
JXTA 1.0
See Also:
EndpointService, EndpointAddress, Message

Method Summary
 void close()
          Close this Endpoint Messenger.
 EndpointAddress getDestinationAddress()
          Return the destination address of this messenger.
 void sendMessage(Message msg)
          Sends a message to the remote peer.
 

Method Detail

getDestinationAddress

public EndpointAddress getDestinationAddress()
Return the destination address of this messenger.
Returns:
destination address of this messenger.

sendMessage

public void sendMessage(Message msg)
                 throws java.io.IOException
Sends a message to the remote peer. The message is not guaranteed to be received by the remote peer, but if no exception is thrown, then the message has been accepted to be sent.
Parameters:
msg - message to be sent.
Throws:
java.io.IOException - is thrown when the message could not be sent.

close

public void close()
Close this Endpoint Messenger. Internal resources can be freed, and the messenger can no longer be used to send messages.

Project JXTA