Sends a complete text message, invoking the callback when complete

@param message The text to send
@param wsChannel The web socket channel
488203
public static void sendTextBlocking(final ByteBuffer message, final WebSocketChannel wsChannel) throws IOException {
        sendBlockingInternal(message, WebSocketFrameType.TEXT, wsChannel);
    }
1286498
public void sendMessage(ISUPMessage msg, int dpc) throws ParameterException, IOException {
        if (!msg.hasAllMandatoryParameters()) {
            throw new ParameterException("Message does not have all required parameters!");
        }
        sendOnCircuit(getCircuit(msg, dpc), msg);
    }
368052
public synchronized void sendMessage(final byte[] message) {
    this.send(ReefServiceProtos.JobStatusProto.newBuilder()
        .setIdentifier(this.jobIdentifier)
        .setState(ReefServiceProtos.State.RUNNING)
        .setMessage(ByteString.copyFrom(message))
        .build());
  }
505490
@Override
    public void processTextMessage(WebSocketChannel channel, String message) {
        LOG.entering(CLASS_NAME, "send", message);

        WebSocketCompositeChannel parent = (WebSocketCompositeChannel)channel;
        if (parent.readyState != ReadyState.OPEN) {
            LOG.warning("Attempt to post message on unopened or closed web socket");
            throw new IllegalStateException("Attempt to post message on unopened or closed web socket");
        }
        
        WebSocketSelectedChannel selectedChannel = parent.selectedChannel;
        selectedChannel.handler.processTextMessage(selectedChannel, message);
    }
1231978
private void sendAck()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "sendAck");

        long completedPrefix = oststream.getCompletedPrefix();

        // Now that all messages are delivered we need to send Acks
        // sendAck back to sending ME (RemoteMessageTransmitter)
        try
        {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                SibTr.debug(tc, "sendAck up to: " + completedPrefix);

            upControl.sendAckMessage(
                                     streamSet.getRemoteMEUuid(),
                                     streamSet.getDestUuid(),
                                     streamSet.getBusUuid(),
                                     completedPrefix,
                                     priority,
                                     reliability,
                                     streamSet.getStreamID(),
                                     true);
            this._lastAckedTick = completedPrefix;
        } catch (SIResourceException e)
        {
            //FFDC
            FFDCFilter.processException(
                                        e,
                                        "com.ibm.ws.sib.processor.gd.GuaranteedTargetStream.sendAck",
                                        "1:2019:1.110",
                                        this);

            SibTr.exception(tc, e);

            //TODO don't know what to do here - rethrow?!
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "sendAck");
    }
265140
public void sendTextMessage(String queueName, String message, int delaySeconds)
            throws NamingException, JMSException, ServiceLocatorException {
        sendTextMessage(null, queueName, message, delaySeconds, null);
    }
288692
public void onMessage(WSMessage message) {
        log.trace("Listeners: {}", listeners.size());
        for (IWebSocketDataListener listener : listeners) {
            try {
                listener.onWSMessage(message);
            } catch (Exception e) {
                log.warn("onMessage exception", e);
            }
        }
    }
984995
public void sendMessage(String message, final Respoke.TaskCompletionListener completionListener) {
        if (isActive()) {
            JSONObject jsonMessage = new JSONObject();
            try {
                jsonMessage.put("message", message);
                byte[] rawMessage = jsonMessage.toString().getBytes(Charset.forName("UTF-8"));
                ByteBuffer directData = ByteBuffer.allocateDirect(rawMessage.length);
                directData.put(rawMessage);
                directData.flip();
                DataChannel.Buffer data = new DataChannel.Buffer(directData, false);

                if (dataChannel.send(data)) {
                    Respoke.postTaskSuccess(completionListener);
                } else {
                    Respoke.postTaskError(completionListener, "Error sending message");
                }
            } catch (JSONException e) {
                Respoke.postTaskError(completionListener, "Unable to encode message to JSON");
            }
        } else {
            Respoke.postTaskError(completionListener, "DataChannel not in an open state");
        }
    }
299994
public void sendMessage(Message message) {
    OutgoingPacket opk = new OutgoingPacket(REQID.zeroREQID, message);
    socketChannelHelper.sendPacket(opk);
  }
1251223
public void send(Type type, final String message) {

        final CmsNotificationMessage notificationMessage = new CmsNotificationMessage(Mode.NORMAL, type, message);
        m_messages.add(notificationMessage);
        if (hasWidget()) {
            m_widget.addMessage(notificationMessage);
        }
        Timer timer = new Timer() {

            @Override
            public void run() {

                removeMessage(notificationMessage);
            }
        };
        timer.schedule(4000 * (type == Type.NORMAL ? 1 : 2));

    }
333496
function sendClientConsoleMessage(ws, message) {
  var msg = JSON.stringify({
    custom: {
      console: message
    }
  });
  ws.write(msg);
}
745241
public void sendSilenceMessage(
    long startStamp,
    long endStamp,
    long completedPrefix,
    boolean requestedOnly,      
    int priority,
    Reliability reliability,
    SIBUuid12 stream)
    throws SIResourceException
  {

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "sendSilenceMessage");

    ControlSilence sMsg;
    try
    {
      // Create new Silence message
      sMsg = cmf.createNewControlSilence();
    }
    catch (Exception e)
    {
      // FFDC
      FFDCFilter.processException(
        e,
        "com.ibm.ws.sib.processor.impl.PtoPOutputHandler.sendSilenceMessage",
        "1:849:1.241",
        this);

      SibTr.exception(tc, e);
      SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002",
        new Object[] {
          "com.ibm.ws.sib.processor.impl.PtoPOutputHandler",
          "1:856:1.241",
          e });

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        SibTr.exit(tc, "sendSilenceMessage", e);

      throw new SIResourceException(
        nls.getFormattedMessage(
          "INTERNAL_MESSAGING_ERROR_CWSIP0002",
          new Object[] {
            "com.ibm.ws.sib.processor.impl.PtoPOutputHandler",
            "1:867:1.241",
            e },
          null),
        e);
    }

    // As we are using the Guaranteed Header - set all the attributes as
    // well as the ones we want.
    SIMPUtils.setGuaranteedDeliveryProperties(sMsg,
        messageProcessor.getMessagingEngineUuid(), 
        targetMEUuid,
        stream,
        null,
        destinationHandler.getUuid(),
        ProtocolType.UNICASTINPUT,
        GDConfig.PROTOCOL_VERSION);
  
    sMsg.setStartTick(startStamp);
    sMsg.setEndTick(endStamp);
    sMsg.setPriority(priority);
    sMsg.setReliability(reliability);
    sMsg.setCompletedPrefix(completedPrefix);

    // If the destination in a Link add Link specific properties to message
    if( isLink )
    {
      sMsg = (ControlSilence)addLinkProps(sMsg);
    }
    
    // If the destination is system or temporary then  the 
    // routingDestination into th message
    if( this.isSystemOrTemp )
    {
      sMsg.setRoutingDestination(routingDestination); 
    }
 
    // Send message to destination
    // Using MPIO
    // If requestedOnly then this is a response to a Nack so resend at priority+1 
    if( requestedOnly )
      mpio.sendToMe(routingMEUuid, priority+1, sMsg);
    else
      mpio.sendToMe(routingMEUuid, priority, sMsg);
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "sendSilenceMessage");

  }
774434
public static void sendCloseBlocking(final ByteBuffer data, final WebSocketChannel wsChannel) throws IOException {
        sendCloseBlocking(new CloseMessage(data), wsChannel);
    }
409594
public void sendMessage(Message message) throws NotConnectedException, InterruptedException {
        // Force the recipient, message type, and thread ID since the user elected
        // to send the message through this chat object.
        message.setTo(participant);
        message.setType(Message.Type.chat);
        message.setThread(threadID);
        chatManager.sendMessage(this, message);
    }
517574
public void sendAsync(BasicMessageWithExtraData<? extends BasicMessage> messageWithData) {
        if (!isConnected()) {
            throw new IllegalStateException("WebSocket connection was closed. Cannot send any messages");
        }

        BasicMessage message = messageWithData.getBasicMessage();
        configurationAuthentication(message);

        sendExecutor.execute(new Runnable() {
            @Override
            public void run() {
                try {
                    if (messageWithData.getBinaryData() == null) {
                        String messageString = ApiDeserializer.toHawkularFormat(message);
                        @SuppressWarnings("resource")
                        Buffer buffer = new Buffer().writeUtf8(messageString);
                        RequestBody requestBody = RequestBody.create(WebSocket.TEXT, buffer.readByteArray());
                        FeedCommProcessor.this.webSocket.sendMessage(requestBody);
                    } else {
                        BinaryData messageData = ApiDeserializer.toHawkularFormat(message,
                                messageWithData.getBinaryData());

                        RequestBody requestBody = new RequestBody() {
                            @Override
                            public MediaType contentType() {
                                return WebSocket.BINARY;
                            }

                            @Override
                            public void writeTo(BufferedSink bufferedSink) throws IOException {
                                emitToSink(messageData, bufferedSink);
                            }
                        };

                        FeedCommProcessor.this.webSocket.sendMessage(requestBody);
                    }
                } catch (Throwable t) {
                    log.errorFailedToSendOverFeedComm(message.getClass().getName(), t);
                }
            }
        });
    }
868244
@Override
  public void handleMessage(Message message) {
    final Crouton crouton = (Crouton) message.obj;
    if (null == crouton) {
      return;
    }
    switch (message.what) {
      case Messages.DISPLAY_CROUTON: {
        displayCrouton();
        break;
      }

      case Messages.ADD_CROUTON_TO_VIEW: {
        addCroutonToView(crouton);
        break;
      }

      case Messages.REMOVE_CROUTON: {
        removeCrouton(crouton);
        if (null != crouton.getLifecycleCallback()) {
          crouton.getLifecycleCallback().onRemoved();
        }
        break;
      }

      default: {
        super.handleMessage(message);
        break;
      }
    }
  }
508436
void sendMessage(IMessage message) throws IOException, AvpDataException, NotInitializedException, ParseException {

    if (!isConnected()) {
      throw new IOException("Failed to send message over [" + socketDescription + "]");
    }

    //switch to wait for SSL handshake to workout.
    if (!isExchangeAllowed()) {
      //TODO: do more?
      return;
    }

    doTLSPreSendProcessing(message);

    final ByteBuffer messageBuffer = this.parser.encodeMessage(message);
    if (logger.isDebugEnabled()) {
      logger.debug("About to send a byte buffer of size [{}] over the TLS socket [{}]", messageBuffer.array().length, socketDescription);
    }
    lock.lock();
    try {
      this.outputStream.write(messageBuffer.array(), messageBuffer.position(), messageBuffer.limit());
      doTLSPostSendProcessing(message);

    } catch (Exception e) {
      logger.debug("Unable to send message", e);
      throw new IOException("Error while sending message: " + e);
    }
    finally {
      lock.unlock();
    }

    if (logger.isDebugEnabled()) {
      logger.debug("Sent a byte buffer of size [{}] over the TLS nio socket [{}]", messageBuffer.array().length, socketDescription);
    }
  }