Do any of the conversion that has to be done for all message types.
@param trxMessage The raw internal trx message.
@return The new Internal message with additional/refined data.
334168
public String getString()
    {
        Object objValue = null;
        if (this.getMessage() != null)
            objValue = this.getMessage().getNative(this.getFullKey(null));
        Class<?> classData = this.getRawClassType();
        try {
            return DataConverters.formatObjectToString(objValue, classData, this.getDefault());
        } catch (Exception ex) {
            return null;
        }
    }
1350962
public int convertInternalToExternal(Object recordOwner)
    {
        if (this.getConvertToNative() == null)
        {
            BaseMessageHeader trxMessageHeader = this.getMessage().getMessageHeader();
            String strMessageClass = (String)trxMessageHeader.get(TrxMessageHeader.MESSAGE_MARSHALLER_CLASS);
            String strPackage = (String)trxMessageHeader.get(TrxMessageHeader.BASE_PACKAGE);
            strMessageClass = ClassServiceUtility.getFullClassName(strPackage, strMessageClass);
            return ((RecordOwner)recordOwner).getTask().setLastError("Converter does not exist: " + strMessageClass);
        }
        Object root = this.getConvertToNative().convertInternalToMarshallableObject((RecordOwner)recordOwner);
        if (root != null)
        {
            this.setRawData(root);
            return DBConstants.NORMAL_RETURN;    // Success
        }
        return super.convertInternalToExternal(recordOwner);
    }
109865
public BaseMessage sendMessageRequest(BaseMessage messageOut)
    {
        TrxMessageHeader trxMessageHeader = (TrxMessageHeader)messageOut.getMessageHeader();
        String strTrxID = (String)trxMessageHeader.get(TrxMessageHeader.LOG_TRX_ID);
        try {
            // Create a fake Incoming message with this message's external data
            String strMessageCode = (String)trxMessageHeader.get(LocalMessageTransport.LOCAL_PROCESSOR);
            TrxMessageHeader trxMessageHeaderIn = new TrxMessageHeader(null, null);
            trxMessageHeaderIn.put(TrxMessageHeader.MESSAGE_CODE, strMessageCode);

            BaseMessage messageIn = new TreeMessage(trxMessageHeaderIn, null);
            new ExternalMapTrxMessageIn(messageIn, messageOut.getExternalMessage().getRawData());
            // And fake send it by calling this:
            BaseMessage messageReply = this.processIncomingMessage(messageIn, null);
            this.logMessage(strTrxID, messageOut, MessageInfoTypeModel.REQUEST, MessageTypeModel.MESSAGE_OUT, MessageStatusModel.SENT, null, null);

            this.setupReplyMessage(messageReply, null, MessageInfoTypeModel.REPLY, MessageTypeModel.MESSAGE_OUT);
            int iErrorCode = this.convertToExternal(messageReply, null);
            if (iErrorCode != DBConstants.NORMAL_RETURN)
            {
                String strMessageDescription = this.getTask().getLastError(iErrorCode);
                if ((strMessageDescription == null) || (strMessageDescription.length() == 0))
                    strMessageDescription = "Error converting to external format";
                messageReply = BaseMessageProcessor.processErrorMessage(this, messageOut, strMessageDescription);
            }

            return messageReply;
        } catch (Throwable ex)  {
            ex.printStackTrace();
            String strError = "Error in processing or replying to a message";
            Utility.getLogger().warning(strError);
            this.logMessage(strTrxID, null, MessageInfoTypeModel.REQUEST, MessageTypeModel.MESSAGE_OUT, MessageStatusModel.ERROR, strError, null);
            return BaseMessageProcessor.processErrorMessage(this, messageOut, strError);
        }
    }
1368545
public BaseConvertToMessage getConvertToMessage()
    {
        if (m_convertToMessage == null)
        {
            BaseMessageHeader trxMessageHeader = this.getMessage().getMessageHeader();
            String strMessageClass = (String)trxMessageHeader.get(TrxMessageHeader.MESSAGE_MARSHALLER_CLASS);
            String strPackage = (String)trxMessageHeader.get(TrxMessageHeader.BASE_PACKAGE);
            strMessageClass = ClassServiceUtility.getFullClassName(strPackage, strMessageClass);
            m_convertToMessage = (BaseConvertToMessage)ClassServiceUtility.getClassService().makeObjectFromClassName(strMessageClass);
            if (m_convertToMessage != null)
            	m_convertToMessage.init(this);
        }
        return m_convertToMessage;
    }
981433
public Info changeMessage(String newMessage) {
        Info newInfo = new Info();
        newInfo.setMessage(newMessage);

        URL url = COMMENT_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID());
        BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), url, "PUT");
        request.setBody(newInfo.getPendingChanges());
        BoxJSONResponse response = (BoxJSONResponse) request.send();
        JsonObject jsonResponse = JsonObject.readFrom(response.getJSON());

        return new Info(jsonResponse);
    }
1188634
public static void enrich(Throwable t, String updateMessage) {
    String newMessage = createMessage(t.getMessage(), updateMessage, t.getClass().getSimpleName());
    replace(t, newMessage);
  }
113127
@SuppressWarnings("unchecked")
    public static UniversalIdIntMessage newInstance() {
        Date now = new Date();
        UniversalIdIntMessage msg = new UniversalIdIntMessage();
        msg.setId(QueueUtils.IDGEN.generateId64()).setTimestamp(now);
        return msg;
    }
841738
@Override
    public Message newMessage(final String message) {
        final ReusableSimpleMessage result = getSimple();
        result.set(message);
        return result;
    }
405261
public static AbstractMessage duplicate( Message srcMessage ) throws JMSException
    {
    	AbstractMessage msgCopy;
    	
        // Internal type copy
        if (srcMessage instanceof AbstractMessage)
        	msgCopy = ((AbstractMessage)srcMessage).copy();
        else
        if (srcMessage instanceof TextMessage)
        	msgCopy = duplicateTextMessage((TextMessage)srcMessage);
        else
        if (srcMessage instanceof ObjectMessage)
        	msgCopy = duplicateObjectMessage((ObjectMessage)srcMessage);
        else
        if (srcMessage instanceof BytesMessage)
        	msgCopy = duplicateBytesMessage((BytesMessage)srcMessage);
        else
        if (srcMessage instanceof MapMessage)
        	msgCopy = duplicateMapMessage((MapMessage)srcMessage);
        else
        if (srcMessage instanceof StreamMessage)
        	msgCopy = duplicateStreamMessage((StreamMessage)srcMessage);
        else
        	msgCopy = duplicateMessage(srcMessage);

        return msgCopy;
    }
1074201
public TrxMessageHeader addMessageProperties(TrxMessageHeader trxMessageHeader)
    {
        Map<String,Object> mapHeaderMessageInfo = trxMessageHeader.getMessageInfoMap();
        
        Map<String,Object> propMessageProcessInfo = ((PropertiesField)this.getField(MessageProcessInfo.PROPERTIES)).loadProperties();
        String strQueueName = this.getQueueName(false);
        if (propMessageProcessInfo.get(MessageConstants.QUEUE_NAME) == null)
            if (strQueueName != null)
                propMessageProcessInfo.put(MessageConstants.QUEUE_NAME, strQueueName);
        String strQueueType = this.getQueueType(false);
        if (propMessageProcessInfo.get(MessageConstants.QUEUE_TYPE) == null)
            if (strQueueType != null)
                propMessageProcessInfo.put(MessageConstants.QUEUE_TYPE, strQueueType);
        if (!this.getField(MessageProcessInfo.REPLY_MESSAGE_PROCESS_INFO_ID).isNull())
            propMessageProcessInfo.put(TrxMessageHeader.MESSAGE_RESPONSE_ID, this.getField(MessageProcessInfo.REPLY_MESSAGE_PROCESS_INFO_ID).toString());
        if (!this.getField(MessageProcessInfo.LOCAL_MESSAGE_PROCESS_INFO_ID).isNull())
            propMessageProcessInfo.put(LocalMessageTransport.LOCAL_PROCESSOR, this.getField(MessageProcessInfo.LOCAL_MESSAGE_PROCESS_INFO_ID).toString());
        if (!this.getField(MessageProcessInfo.MESSAGE_TYPE_ID).isNull())
        {
            MessageType recMessageType = (MessageType)((ReferenceField)this.getField(MessageProcessInfo.MESSAGE_TYPE_ID)).getReference();
            if (recMessageType != null)
                propMessageProcessInfo.put(TrxMessageHeader.MESSAGE_PROCESS_TYPE, recMessageType.getField(MessageType.CODE).toString());
        }
        
        if (!this.getField(MessageProcessInfo.PROCESSOR_CLASS).isNull())
            propMessageProcessInfo.put(TrxMessageHeader.MESSAGE_PROCESSOR_CLASS, this.getField(MessageProcessInfo.PROCESSOR_CLASS).toString());
        if (mapHeaderMessageInfo != null)
            mapHeaderMessageInfo.putAll(propMessageProcessInfo);
        else
            mapHeaderMessageInfo = propMessageProcessInfo;
        if (mapHeaderMessageInfo.get(TrxMessageHeader.MESSAGE_PROCESSOR_CLASS) == null)
            this.setDefaultMessageProcessor(mapHeaderMessageInfo);
        trxMessageHeader.setMessageInfoMap(mapHeaderMessageInfo);
        
        trxMessageHeader.put(TrxMessageHeader.MESSAGE_PROCESS_INFO_ID, this.getCounterField().toString());
        
        String strDescription = this.getField(MessageProcessInfo.DESCRIPTION).toString();
        if (((ReferenceField)this.getField(MessageProcessInfo.MESSAGE_INFO_ID)).getReference() != null)
            if (!((ReferenceField)this.getField(MessageProcessInfo.MESSAGE_INFO_ID)).getReference().getField(MessageInfo.DESCRIPTION).isNull())
                strDescription = ((ReferenceField)this.getField(MessageProcessInfo.MESSAGE_INFO_ID)).getReference().getField(MessageInfo.DESCRIPTION).toString();
        trxMessageHeader.put(TrxMessageHeader.DESCRIPTION, strDescription);
        
        return trxMessageHeader;
    }
530353
@Override
    public Message newMessage(final Object message) {
        final ReusableObjectMessage result = getObject();
        result.set(message);
        return result;
    }
1356496
protected Message createMessage(TestContext context, String messageType) {
        if (dataDictionary != null) {
            messageBuilder.setDataDictionary(dataDictionary);
        }

        return messageBuilder.buildMessageContent(context, messageType, MessageDirection.OUTBOUND);
    }
1117531
@Override
    public IQueueMessage<ID, DATA> createMessage(DATA content) {
        return messageFactory.createMessage(content);
    }
703971
public static Message create( String text, Object data, ProcessingUnit owner  )
    {
        return new SimpleMessage( text, data, owner);
    }
394096
function(msg) {
				msg.addOption(new Option(Message.Option.URI_PATH, new Buffer("c")));
				msg.addOption(new Option(Message.Option.URI_QUERY, encodedCrc));
				if (includeIndex) {
					var idxBin = messages.ToBinary(chunkIndex, "uint16");
					msg.addOption(new Option(Message.Option.URI_QUERY, idxBin));
				}
				return msg;
			}
168675
@Override
    public Message newMessage(final String message, final Object... params) {
        return getParameterized().set(message, params);
    }
181282
public <T> Message build(MessageBodyConverter<T> converter) {
        if (StringUtils.isBlank(this.topic)) {
            throw new IllegalArgumentException("Blank topic");
        }
        if (this.body == null && this.payload == null) {
            throw new IllegalArgumentException("Empty payload");
        }
        byte[] payload = this.payload;
        if (payload == null && converter != null) {
            try {
                payload = converter.toByteArray((T) this.body);
            }
            catch (MetaClientException e) {
                throw new IllegalStateException("Convert message body failed.", e);
            }
        }

        if (payload == null) {
            throw new IllegalArgumentException("Empty payload");
        }
        return new Message(this.topic, payload, this.attribute);
    }