Class RMQTextMessage

  • All Implemented Interfaces:
    jakarta.jms.Message, jakarta.jms.TextMessage, java.lang.Cloneable

    public class RMQTextMessage
    extends RMQMessage
    implements jakarta.jms.TextMessage
    Implements TextMessage interface.
    • Constructor Detail

      • RMQTextMessage

        public RMQTextMessage()
    • Method Detail

      • setText

        public void setText​(java.lang.String string)
                     throws jakarta.jms.JMSException
        Specified by:
        setText in interface jakarta.jms.TextMessage
        Throws:
        jakarta.jms.JMSException
      • getText

        public java.lang.String getText()
                                 throws jakarta.jms.JMSException
        Specified by:
        getText in interface jakarta.jms.TextMessage
        Throws:
        jakarta.jms.JMSException
      • writeBody

        public void writeBody​(java.io.ObjectOutput out,
                              java.io.ByteArrayOutputStream bout)
                       throws java.io.IOException
        Invoked when RMQMessage.toByteArray() is called to create a byte[] from a message. Each subclass must implement this, but ONLY write its specific body. All the properties defined in Message will be written by the parent class.
        Specified by:
        writeBody in class RMQMessage
        Parameters:
        out - - the output stream to which the structured part of message body (scalar types) is written
        bout - - the output stream to which the un-structured part of message body (explicit bytes) is written
        Throws:
        java.io.IOException - if the body can not be written
      • readBody

        protected void readBody​(java.io.ObjectInput inputStream,
                                java.io.ByteArrayInputStream bin)
                         throws java.io.IOException,
                                java.lang.ClassNotFoundException
        Invoked when a message is being deserialized to read and decode the message body. The implementing class should only read its body from this stream. If any exception is thrown, the message will not have been delivered.
        Specified by:
        readBody in class RMQMessage
        Parameters:
        inputStream - - the stream to read its body from
        bin - - the underlying byte input stream
        Throws:
        java.io.IOException - if a read error occurs on the input stream
        java.lang.ClassNotFoundException - if the object class cannot be found
      • readAmqpBody

        protected void readAmqpBody​(byte[] barr)
        Description copied from class: RMQMessage
        Invoked when an AMQP message is being transformed into a RMQMessage The implementing class should only read its body by this method
        Specified by:
        readAmqpBody in class RMQMessage
        Parameters:
        barr - - the byte array payload of the AMQP message
      • doGetBody

        protected <T> T doGetBody​(java.lang.Class<T> c)
                           throws jakarta.jms.JMSException
        Specified by:
        doGetBody in class RMQMessage
        Throws:
        jakarta.jms.JMSException
      • writeAmqpBody

        protected void writeAmqpBody​(java.io.ByteArrayOutputStream out)
                              throws java.io.IOException
        Description copied from class: RMQMessage
        Invoked when RMQMessage.toAmqpByteArray() is called to create a byte[] from a message. Each subclass must implement this, but ONLY write its specific body.
        Specified by:
        writeAmqpBody in class RMQMessage
        Parameters:
        out - - the output stream to which the message body is written
        Throws:
        java.io.IOException - if the body can not be written
      • isBodyAssignableTo

        public boolean isBodyAssignableTo​(java.lang.Class c)
        Specified by:
        isBodyAssignableTo in interface jakarta.jms.Message
      • recreate

        public static RMQMessage recreate​(jakarta.jms.TextMessage msg)
                                   throws jakarta.jms.JMSException
        Throws:
        jakarta.jms.JMSException