Project JXTA

Uses of Class
net.jxta.endpoint.Message

Packages that use Message
net.jxta.endpoint Provides interfaces and classes used for the addressing, filtering, sending, and receiving of messages within JXTA. 
net.jxta.pipe Pipes are the core mechanism for exchanging messages between JXTA applications or services. 
net.jxta.rendezvous The RendezVous Service is responsible for propagating messages within a JXTA PeerGroup. 
net.jxta.socket The socket package provides interface ala Socket over JXTA pipes.  
net.jxta.util A collection of utility classes used by the JXTA implementation and/or useful to users of the JXTA API. 
 

Uses of Message in net.jxta.endpoint
 

Methods in net.jxta.endpoint that return Message
 Message MessageFilterListener.filterMessage(Message message, EndpointAddress srcAddr, EndpointAddress dstAddr)
          This method is invoked by the EndpointService for each message for which this filter is registered.
 Message EndpointFilterListener.processIncomingMessage(Message message, EndpointAddress srcAddr, EndpointAddress dstAddr)
          Deprecated. This method is invoked by the EndpointService for each incoming message that contains a message element associated to this Endpoint Filter.
 

Methods in net.jxta.endpoint with parameters of type Message
 boolean ThreadedMessenger.sendMessageN(Message msg, String service, String serviceParam)
          Sends a message to the destination specified at construction. If a service name and service param are specified, they will replace those specified at construction for the purpose of sending this message only.

This method is identical to Messenger.sendMessage(Message, String, String), except that it does not throw an exception. The invoker has to retrieve a detailed status from the message if needed.

Error Handling:

  • A return result of false indicates that the message was not accepted to be sent. This may be due to local resource limits being reached or to the messenger being in a state that is not Messenger.USABLE or to the message being invalid. The exact cause of the failure can be retrieved from the message by using Message.getMessageProperty(Messenger.class). If appropriate, another attempt at sending the message, may be made after waiting for the congestion to clear (for example by using Messenger.waitState(int, long)).
  • A return result of true indicates that the message was accepted for sending. It does not imply that the message will be sent or that the destination will receive the message. There will be no indication by this method of any errors in sending the message. If this messenger subsequently reaches an Messenger.IDLE state that is either Messenger.CLOSED or a Messenger.USABLE state, then it may be inferred that all outsdanding messages have been processed without this messenger detecting an error.
  • The invoker may have confirmation of completion (succesfull or not) by observing the message's properties. When the message has been fully processed, Message.getMessageProperty(Messenger.class) will return an object of class OutgoingMessageEvent. Changes in a message's set of properties may be tracked by selecting the message.

WARNING: The Message object should not be reused or modified until completely processed. Concurrent modification of a message while a messenger is sending the message will produce incorrect and unpredictable results. If completion is not monitored, the message should never be reused. If necessary, a clone of the message may be provided to Messenger.sendMessageN(net.jxta.endpoint.Message, java.lang.String, java.lang.String):

     messenger.sendMessageN( (Message) myMessage.clone(), theService, theParam );
 

There is no guarantee that a message successfully sent will actually be received.

In this case, this method is here out of principle but is not really expected to be invoked.

 void ThreadedMessenger.sendMessageB(Message msg, String service, String serviceParam)
           
protected abstract  void ThreadedMessenger.sendMessageBImpl(Message msg, String service, String param)
          Sends message through underlying connection.
 void Messenger.sendMessageB(Message msg, String service, String serviceParam)
          Simple sending: blocks until the message was accepted for sending or the messenger is not Messenger.USABLE; whichever occurs first.
 boolean Messenger.sendMessageN(Message msg, String service, String serviceParam)
          Sends a message to the destination specified at construction.
 boolean Messenger.sendMessage(Message msg)
          Sends a message to the destination specified at construction as if by invoking sendMessage(msg, null, null)

This is a legacy method.

 boolean Messenger.sendMessage(Message msg, String service, String serviceParam)
          Sends a message to the destination specified at construction.
 void Messenger.sendMessage(Message msg, String service, String serviceParam, OutgoingMessageEventListener listener)
          Deprecated. This legacy method is being phased out. Prefer Messenger.sendMessageN(net.jxta.endpoint.Message, java.lang.String, java.lang.String) to send messages in a non blocking fashion.
 void MessageSender.propagate(Message msg, String serviceName, String serviceParams, String prunePeer)
          Propagates a Message on this Message Transport.
 Message MessageFilterListener.filterMessage(Message message, EndpointAddress srcAddr, EndpointAddress dstAddr)
          This method is invoked by the EndpointService for each message for which this filter is registered.
 boolean ListenerAdaptor.watchMessage(OutgoingMessageEventListener listener, Message m)
          Select the given message and invoke the given listener when the message sending is complete.
 void EndpointService.propagate(Message srcMsg, String serviceName, String serviceParam)
          Propagates the given message through all the endpoint protocols that are available to this endpoint.
 void EndpointService.demux(Message msg)
          Delivers the provided message to the correct listener as specified by the message's destination address.
 void EndpointListener.processIncomingMessage(Message message, EndpointAddress srcAddr, EndpointAddress dstAddr)
          This method is invoked by the EndpointService for each incoming message which is addressed to this listener.
 Message EndpointFilterListener.processIncomingMessage(Message message, EndpointAddress srcAddr, EndpointAddress dstAddr)
          Deprecated. This method is invoked by the EndpointService for each incoming message that contains a message element associated to this Endpoint Filter.
 void ChannelMessenger.sendMessage(Message msg, String service, String serviceParam, OutgoingMessageEventListener listener)
          Deprecated. Implements deprecated method.
 boolean AsyncChannelMessenger.sendMessageN(Message msg, String rService, String rServiceParam)
          Sends a message to the destination specified at construction. If a service name and service param are specified, they will replace those specified at construction for the purpose of sending this message only.

This method is identical to Messenger.sendMessage(Message, String, String), except that it does not throw an exception. The invoker has to retrieve a detailed status from the message if needed.

Error Handling:

  • A return result of false indicates that the message was not accepted to be sent. This may be due to local resource limits being reached or to the messenger being in a state that is not Messenger.USABLE or to the message being invalid. The exact cause of the failure can be retrieved from the message by using Message.getMessageProperty(Messenger.class). If appropriate, another attempt at sending the message, may be made after waiting for the congestion to clear (for example by using Messenger.waitState(int, long)).
  • A return result of true indicates that the message was accepted for sending. It does not imply that the message will be sent or that the destination will receive the message. There will be no indication by this method of any errors in sending the message. If this messenger subsequently reaches an Messenger.IDLE state that is either Messenger.CLOSED or a Messenger.USABLE state, then it may be inferred that all outsdanding messages have been processed without this messenger detecting an error.
  • The invoker may have confirmation of completion (succesfull or not) by observing the message's properties. When the message has been fully processed, Message.getMessageProperty(Messenger.class) will return an object of class OutgoingMessageEvent. Changes in a message's set of properties may be tracked by selecting the message.

WARNING: The Message object should not be reused or modified until completely processed. Concurrent modification of a message while a messenger is sending the message will produce incorrect and unpredictable results. If completion is not monitored, the message should never be reused. If necessary, a clone of the message may be provided to Messenger.sendMessageN(net.jxta.endpoint.Message, java.lang.String, java.lang.String):

     messenger.sendMessageN( (Message) myMessage.clone(), theService, theParam );
 

There is no guarantee that a message successfully sent will actually be received.

 void AsyncChannelMessenger.sendMessageB(Message msg, String rService, String rServiceParam)
          Simple sending: blocks until the message was accepted for sending or the messenger is not Messenger.USABLE; whichever occurs first. If a service name and service param are specified, they will replace those specified at construction for the purpose of sending this message only.

Error Handling:

  • An IOException means that this message is invalid or that this messenger is now in one of the non Messenger.USABLE states and may no longer send new messages, and means that the message was not sent. The exact state of the messenger may be obtained from the Messenger.getState() method. If no exception is thrown, the message is accepted for sending and may or may not be fully processed.
  • The invoker may have confirmation of completion by observing the message's properties. When the message has been fully processed, Message#getMessageProperty(Messenger.class) will return an object of class OutgoingMessageEvent. Changes in a message's set of properties may be tracked by selecting the message. If an exception was thrown, the message's properties will not be modified
  • There is no guarantee that the process of sending the message will not fail after that method returned. If this messenger subsequently reaches an Messenger.IDLE state that is either Messenger.CLOSED or a Messenger.USABLE state, then it may be inferred that all outsdanding messages have been processed without this messenger detecting an error.

WARNING: The Message object should not be reused or modified until completely processed. Concurrent modification of a message while a messenger is sending the message will produce incorrect and unpredictable results. If completion is not monitored, the message should never be reused. If necessary, a clone of the message may be provided to Messenger.sendMessageB(net.jxta.endpoint.Message, java.lang.String, java.lang.String):

     messenger.sendMessageB( (Message) myMessage.clone(), theService, theParam );
 

There is no guarantee that a message successfully sent will actually be received.

 boolean AbstractMessenger.sendMessage(Message msg)
          Sends a message to the destination specified at construction as if by invoking sendMessage(msg, null, null)

This is a legacy method. Modern code should prefer the other methods and select messages. If a listener API is preferred, it is possible to use a ListenerAdaptor object explicitly to have a listener called.

 void AbstractMessenger.sendMessage(Message msg, String service, String serviceParam, OutgoingMessageEventListener listener)
          Deprecated. Implements deprecated method. Actual support only provided by channels.
 boolean AbstractMessenger.sendMessage(Message msg, String rService, String rServiceParam)
          Sends a message to the destination specified at construction. If a service name and service param are specified, they will replace those specified at construction for the purpose of sending this message only.

Error Handling:

  • An IOException means that this message is invalid or that this messenger is now in one of the non Messenger.USABLE states and may no longer send new messages, and that the message was not sent. The exact state of the messenger may be obtained from the Messenger.getState() method.
  • A return result of false indicates that the message was not accepted to be sent. Usually this is due to local resource limits being reached. If needed, another attempt at sending the message, may be made after waiting for the congestion to clear (for example by using Messenger.waitState(int, long)).
  • A return result of true indicates that the message was accepted for sending. It does not imply that the message will be sent or that the destination will receive the message. There will be no immediate indication of any errors in sending the message. If this messenger subsequently reaches an Messenger.IDLE state that is either Messenger.CLOSED or a Messenger.USABLE state, then it may be inferred that all outsdanding messages have been processed without this messenger detecting an error.
  • The invoker may have confirmation of completion by observing the message's properties. When the message has been fully processed, Message.getMessageProperty(Messenger.class) will return an object of class OutgoingMessageEvent. Changes in a message's set of properties may be tracked by selecting the message.

WARNING: The Message object should not be reused or modified until completely processed. Concurrent modification of a message while a messenger is sending the message will produce incorrect and unpredictable results. If completion is not monitored, the message should never be reused. If necessary, a clone of the message may be provided to sendMessage:

     messenger.sendMessage( (Message) myMessage.clone(), theService, theParam );
 

There is no guarantee that a message successfully sent will actually be received.

Limitation: using this method along with SimpleSelector.select() on the same message may occasionaly cause some errors to not be thrown. Prefer Messenger.sendMessageN(net.jxta.endpoint.Message, java.lang.String, java.lang.String) when using SimpleSelector.select().

This is a legacy method. Modern code should prefer the other methods and select messages. If a listener API is preferred, it is possible to use a ListenerAdaptor object explicitly to have a listener called.

 

Constructors in net.jxta.endpoint with parameters of type Message
OutgoingMessageEvent(Message source)
          Create an Outgoing Message Event.
OutgoingMessageEvent(Message source, Throwable failure)
          Create an Outgoing Message Event.
 

Uses of Message in net.jxta.pipe
 

Methods in net.jxta.pipe that return Message
 Message PipeService.createMessage()
          Deprecated. Use new Message() instead.
 Message PipeMsgEvent.getMessage()
          Returns the message associated with the event
 Message InputPipe.waitForMessage()
          Wait (block) for a message to be received.
 Message InputPipe.poll(int timeout)
          Poll for a message from the pipe.
 

Methods in net.jxta.pipe with parameters of type Message
 boolean OutputPipe.send(Message msg)
          Send a message throught the pipe

WARNING: The message object used when sending a pipe message should not be reused or modified after the OutputPipe.send(Message) call is made.

 

Constructors in net.jxta.pipe with parameters of type Message
PipeMsgEvent(Object source, Message message, PipeID pipeID)
          Creates a new event
 

Uses of Message in net.jxta.rendezvous
 

Methods in net.jxta.rendezvous with parameters of type Message
 void RendezVousService.propagate(Message msg, String serviceName, String serviceParam, int ttl)
          Propagates a message to the local network and to as many members of the peer group as possible.
 void RendezVousService.propagate(Enumeration destPeerIds, Message msg, String serviceName, String serviceParam, int ttl)
          Propagates a message to the specified peers.
 void RendezVousService.propagateToNeighbors(Message msg, String serviceName, String serviceParam, int ttl, String prunePeer)
          Deprecated. no need to specify prune peer
 void RendezVousService.propagateToNeighbors(Message msg, String serviceName, String serviceParam, int ttl)
          Propagates a message to members of the peer group reachable via the local network.
 void RendezVousService.propagateInGroup(Message msg, String serviceName, String serviceParam, int ttl, String prunePeer)
          Deprecated. no need to specify prune peer
 void RendezVousService.propagateInGroup(Message msg, String serviceName, String serviceParam, int ttl)
          Propagates a message to as many members of the peer group as possible.
 void RendezVousService.walk(Message msg, String serviceName, String serviceParam, int ttl)
          Walk a message through the rendezvous peers of the network: only rendezvous peers will receive the message.
 void RendezVousService.walk(Vector destPeerIDs, Message msg, String serviceName, String serviceParam, int ttl)
          

Walk a message through the rendezvous peers of the network: only rendezvous peers will receive the message.

 

Uses of Message in net.jxta.socket
 

Methods in net.jxta.socket that return Message
protected  Message JxtaSocket.createOpenMessage(PeerGroup group, PipeAdvertisement pipeAd)
          Create a connection request message
 

Uses of Message in net.jxta.util
 

Methods in net.jxta.util that return Message
protected  Message JxtaBiDiPipe.createOpenMessage(PeerGroup group, PipeAdvertisement pipeAd)
          Create a connection request message
 Message JxtaBiDiPipe.getMessage(int timeout)
          Gets a message from the queue.
 

Methods in net.jxta.util with parameters of type Message
static void MessageUtilities.addInt(Message message, String tagName, int value)
          Deprecated.  
static int MessageUtilities.getInt(Message message, String tagName, int defaultValue)
          Deprecated.  
static void MessageUtilities.addLong(Message message, String tagName, long value)
          Deprecated.  
static long MessageUtilities.getLong(Message message, String tagName, long defaultValue)
          Deprecated.  
static void MessageUtilities.addDouble(Message message, String tagName, double value)
          Deprecated.  
static double MessageUtilities.getDouble(Message message, String tagName, double defaultValue)
          Deprecated.  
static void MessageUtilities.addBoolean(Message message, String tagName, boolean value)
          Deprecated.  
static boolean MessageUtilities.getBoolean(Message message, String tagName, boolean defaultValue)
          Deprecated.  
static void MessageUtilities.addString(Message message, String tagName, String value)
          Deprecated.  
static String MessageUtilities.getString(Message message, String tagName, String defaultValue)
          Deprecated.  
 void JxtaBiDiPipe.processIncomingMessage(Message message)
          /** This method is invoked by the Reliablity library for each incoming data message
 boolean JxtaBiDiPipe.sendMessage(Message msg)
          Send a message
 


JXTA J2SE