public String sendRR(Message message, EndPoint[] to, IAsyncCallback cb) {
   String messageId = message.getMessageId();
   callbackMap_.put(messageId, cb);
   for (int i = 0; i < to.length; ++i) {
     sendOneWay(message, to[i]);
   }
   return messageId;
 }
  public void sendUdpOneWay(Message message, EndPoint to) {
    EndPoint from = message.getFrom();
    if (message.getFrom().equals(to)) {
      MessagingService.receive(message);
      return;
    }

    UdpConnection connection = null;
    try {
      connection = new UdpConnection();
      connection.init();
      connection.write(message, to);
    } catch (IOException e) {
      logger_.warn(LogUtil.throwableToString(e));
    } finally {
      if (connection != null) connection.close();
    }
  }
  /*
      Use this version for fire and forget style messaging.
  */
  public void sendOneWay(Message message, EndPoint to) {
    // do local deliveries
    if (message.getFrom().equals(to)) {
      MessagingService.receive(message);
      return;
    }

    Runnable tcpWriteEvent = new MessageSerializationTask(message, to);
    messageSerializerExecutor_.execute(tcpWriteEvent);
  }
 public static void receive(Message message) {
   enqueueRunnable(message.getMessageType(), new MessageDeliveryTask(message));
 }
 public IAsyncResult sendRR(Message message, EndPoint to) {
   IAsyncResult iar = new AsyncResult();
   taskCompletionMap_.put(message.getMessageId(), iar);
   sendOneWay(message, to);
   return iar;
 }
 public String sendRR(Message message, EndPoint to, IAsyncCallback cb) {
   String messageId = message.getMessageId();
   callbackMap_.put(messageId, cb);
   sendOneWay(message, to);
   return messageId;
 }