Create a pre-defined payload with a simple alert message.

@param message the alert's message
@return a ready-to-send payload
174697
public static PushNotificationPayload alert(String message) {
		if (message == null) throw new IllegalArgumentException("Alert cannot be null");
		PushNotificationPayload payload = complex();
		try {
			payload.addAlert(message);
		} catch (JSONException e) {
		}
		return payload;
	}
1092072
function(message) {
    if (!_.isObject(message)) {
      message = {
        message: message
      };
    }

    try {
      message = JSON.stringify(_.defaultsDeep({}, message, this.config.defaultProps));
    } catch (e) {
      return this.logger.error('Logmatic - error while parsing log message. Not sending', e);
    }

    if (this.isConnected) {
      this.sendMessage(message);
    } else {
      this.messageBuffer.push(message);
    }
  }
188410
@Override
	public MessageToClient createMessageToClient(MessageFromClient message, HttpSession client) {
		return super.createMessageToClient(message, client);
	}
583672
@Factory
    public static <T extends Throwable> Matcher<T> withMessage(String message) {
        return withMessage(is(message));
    }
1306171
public byte[] sendWithResult(final byte[] message) {
        synchronized (webSocketHandler.getNotifyResultObject()) {
            webSocketHandler.sendMessage(message);

            try {
                webSocketHandler.getNotifyResultObject().wait(TimeUnit.SECONDS.toMillis(ANSWER_TIMEOUT));
            }
            catch (InterruptedException e) {
                return null;
            }

            return webSocketHandler.getResultBytes();
        }
    }
607376
protected UserMessage createTellMessage (BodyObject source, String message)
    {
        return UserMessage.create(source.getVisibleName(), message);
    }
117295
String asJson( WebSocketMessage message ) {

		String result = null;
		try {
			ObjectMapper mapper = JSonBindingUtils.createObjectMapper();
			StringWriter writer = new StringWriter();
			mapper.writeValue( writer, message );
			result = writer.toString();

		} catch( IOException e ) {
			this.logger.severe( "A notification could not be prepared. It will not be sent. " + e.getMessage());
			Utils.logException( this.logger, e );
		}

		return result;
	}
841738
@Override
    public Message newMessage(final String message) {
        final ReusableSimpleMessage result = getSimple();
        result.set(message);
        return result;
    }
5087
public AbstractMessageContentBuilder constructMessageBuilder(Element messageElement) {
        AbstractMessageContentBuilder messageBuilder = null;
        
        if (messageElement != null) {
            messageBuilder = parsePayloadTemplateBuilder(messageElement);
            
            if (messageBuilder == null) {
                messageBuilder = parseScriptBuilder(messageElement);
            }
        }

        if (messageBuilder == null) {
            messageBuilder = new PayloadTemplateMessageBuilder();
        }

        if (messageElement != null && messageElement.hasAttribute("name")) {
            messageBuilder.setMessageName(messageElement.getAttribute("name"));
        }

        return messageBuilder;
    }
105770
public final Trace alert(Class<?> c, String message) {
        return _trace.alert(c, message);
    }
564527
protected static String message(Object message)
  {
    if(message == null) {
      return null;
    }
    if(!(message instanceof Throwable)) {
      return message.toString();
    }

    Throwable t = (Throwable)message;
    if(t.getCause() == null) {
      return t.toString();
    }

    int nestingLevel = 0;
    StringBuilder sb = new StringBuilder();
    for(;;) {
      sb.append(t.getClass().getName());
      sb.append(":");
      sb.append(" ");
      if(++nestingLevel == 8) {
        sb.append("...");
        break;
      }
      if(t.getCause() == null) {
        String s = t.getMessage();
        if(s == null) {
          t.getClass().getCanonicalName();
        }
        sb.append(s);
        break;
      }
      t = t.getCause();
    }
    return sb.toString();
  }
598267
private Handler<AsyncResult<String>> createDeploymentHandler(final Message<JsonObject> message) {
    return new Handler<AsyncResult<String>>() {
      @Override
      public void handle(AsyncResult<String> result) {
        if (result.failed()) {
          message.reply(new JsonObject().putString("status", "error").putString("message", result.cause().getMessage()));
        } else {
          addNewDeployment(result.result(), message.body(), new Handler<AsyncResult<String>>() {
            @Override
            public void handle(AsyncResult<String> result) {
              message.reply(new JsonObject().putString("status", "ok").putString("id", result.result()));
            }
          });
        }
      }
    };
  }
765247
public static Builder from(GatewayMessage message) {
    return new Builder().headers(message.headers).data(message.data);
  }
1266428
public Message createMessage(ByteBuffer buffer) {

        if (!isHeaderReady) {
            int len = Math.min(MESSAGE_HEADER_SIZE - pos, buffer.remaining());
            buffer.get(header, pos, len);

            // update cursor postion in the header's buffer
            pos += len;

            // header completed?
            isHeaderReady = pos == header.length;

            if (!isHeaderReady) {
                // no more data available
                return null;
            }

            // obtain remaining length of the message and prepare buffer
            length = ((header[0] & 0xff) << 24);
            length += ((header[1] & 0xff) << 16);
            length += ((header[2] & 0xff) << 8);
            length += (header[3] & 0xff);

            length -= MESSAGE_HEADER_SIZE;

            params = new byte[length];

            // finally switch cursor position
            pos = 0;

            message = new Message();
        }

        // at this point we must recheck remainder of the input buffer
        // because possible case when input buffer fits exactly to the header
        if (length > 0 && !buffer.hasRemaining()) {
            return null;
        }

        // again, reading all parameters before parsing

        // compute available or required data
        int len = Math.min((params.length - pos), buffer.remaining());
        buffer.get(params, pos, len);

        // update cursor position
        pos += len;

        // end of message not reached
        if (pos < params.length) {
            return null;
        }

        // end of message reached and most probably some data remains in buffer
        // do not touch remainder of the input buffer, next call to this method
        // will proceed remainder

        // parsing params of this message
        message.decode(params);

        // switch factory for receiving new message
        this.isHeaderReady = false;
        this.pos = 0;

        // return
        return message;
    }
887169
public static UserMessage create (Name speaker, String message)
    {
        return new UserMessage(speaker, null, message, ChatCodes.DEFAULT_MODE);
    }
530353
@Override
    public Message newMessage(final Object message) {
        final ReusableObjectMessage result = getObject();
        result.set(message);
        return result;
    }
226887
protected String createSoapFaultResponse(String message)
            throws SOAPException, TransformerException {
        return createSoapFaultResponse(SOAPConstants.SOAP_1_1_PROTOCOL, null, message);
    }