<p>checkMessageSize.</p>

@param message        a {@link java.lang.Object} object.
@param maxMessageSize a long.
481845
protected static void checkMessageSize(Object message, long maxMessageSize) {
        if (maxMessageSize != -1) {
            final long messageSize =
                    (message instanceof String ? ((String) message).getBytes(Charset.defaultCharset()).length
                            : ((ByteBuffer) message).remaining());

            if (messageSize > maxMessageSize) {
                throw new MessageTooBigException(
                        Messages.get("web.socket.error.message.too.long", maxMessageSize, messageSize)
                );
            }
        }
    }
1234338
public void sendMessage(Message message)
    {
        if (message == null)
            return;     // Don't allow a null message to be sent.
        m_stack.add(message);
        if (m_bWaiting)
        {
            synchronized (m_thread)
            {
                if (m_bWaiting) // Inside the sync block
                    m_thread.notify();
            }
        }
    }
1165211
protected int getMaxMessageLength(Dsn dsn) {
        return Util.parseInteger(
            Lookup.lookup(MAX_MESSAGE_LENGTH_OPTION, dsn), JsonMarshaller.DEFAULT_MAX_MESSAGE_LENGTH);
    }
36664
@Override
  public void logMessage(LogLevel logLevel, String message, Class clazz, String methodName) {
    Logger logger = Logger.getLogger(clazz.getName());
    logger.logp(convertToJDK14Level(logLevel), clazz.getName(), methodName, message);
  }
829418
@Override
    public Message newMessage(final String message, final Object... params) {
        if (params == null) {
            return new SimpleMessage(message);
        }
        final ParameterizedMessage msg = new ParameterizedMessage(message, params);
        return new StatusMessage(msg.getFormattedMessage(), msg.getThrowable());
    }
301795
public void addMessage(String message, int x, int y, long time)
    {
        messages.add(new MessageData(message, x, y, time));
        hasMessage = true;
    }
1070915
public Result check(IMessage message) {
    if (message == null) {
      throw new IllegalArgumentException("Message is null");
    }
    if (!enable) {
      return SUCCESS;
    }
    // todo
    return null;
  }
321794
public List<String> receiveTextMessages(int maxSize) {
        List<String> messages = new ArrayList<>();
        try {
            while (messages.size() <= maxSize){
                TextMessage message = (TextMessage) consumer.receive(timeout);
                if (message == null) {
                    return messages;
                }else {
                    messages.add(message.getText());
                }
            }
        } catch (JMSException e) {
            throw new AsyncException(e);
        }
        return messages;
    }
828801
public void setMessage(CharSequence message){
        if(mConstruct != null && !mConstruct.getDesign().isMaterial()){
            TextView msgView = (TextView) getDialog().findViewById(R.id.message);
            msgView.setText(message);
        }else{
            if(mMessage != null){
                mMessage.setText(message);
            }
        }
    }
928160
public int handleMessage(BaseMessage message)
    {
            try   {
                int iMessageType = Integer.parseInt((String)message.get(MessageConstants.MESSAGE_TYPE_PARAM));
                if ((iMessageType == Constants.AFTER_UPDATE_TYPE)
                        || (iMessageType == Constants.CACHE_UPDATE_TYPE))
                    { // Record updated - be very careful, you are running in an independent thread.
                        SwingUtilities.invokeLater(new UpdateScreenRecord(iMessageType));
                    }
            } catch (NumberFormatException ex)  {
                // Ignore
            }
        return super.handleMessage(message);
    }
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);
            }
        }
    }
199201
protected void addMessage(String message)
    {
        messages.add(message);
        messageCount++;
        if (messageCount > messagesQueueMax)
        {
            messages.remove();
            messageCount--;
        }
    }
753529
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/2563")
  public CallOptions withMaxOutboundMessageSize(int maxSize) {
    checkArgument(maxSize >= 0, "invalid maxsize %s", maxSize);
    CallOptions newOptions = new CallOptions(this);
    newOptions.maxOutboundMessageSize = maxSize;
    return newOptions;
  }
199188
public final void error(Object message) {

        if (isLevelEnabled(SimpleLog.LOG_LEVEL_ERROR)) {
            log(SimpleLog.LOG_LEVEL_ERROR, message, null);
        }
    }
253372
public void setMessage( Message message ) {
        Assert.notNull(message, "The message is required");
        Assert.hasText( message.getMessage(), "The message text is required" );
        this.message = message;
    }
1040494
@SuppressWarnings({"unused", "WeakerAccess"})
    public void deleteInboxMessage(final CTInboxMessage message){
        postAsyncSafely("deleteInboxMessage", new Runnable() {
            @Override
            public void run() {
                synchronized (inboxControllerLock) {
                    if (ctInboxController != null) {
                       boolean update = ctInboxController.deleteMessageWithId(message.getMessageId());
                       if (update) {
                           _notifyInboxMessagesDidUpdate();
                       }
                    } else {
                        getConfigLogger().debug(getAccountId(), "Notification Inbox not initialized");
                    }
                }
            }});
    }
1328785
public synchronized long sendMessage(AbstractRequestMessage message) {
    log.debug("Sending {} to {}", message, this);
    message.setTicketNumber(this.nextTicketNumber.getAndIncrement());
    this.outstandingRequests.put(Long.valueOf(message.getTicketNumber()),
        message);
    this.session.write(message);
    return message.getTicketNumber();
  }