Class RMQObjectMessage

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

    public class RMQObjectMessage
    extends RMQMessage
    implements jakarta.jms.ObjectMessage
    Implements ObjectMessage interface.
    • Constructor Detail

      • RMQObjectMessage

        public RMQObjectMessage()
      • RMQObjectMessage

        public RMQObjectMessage​(java.util.List<java.lang.String> trustedPackages)
    • Method Detail

      • setObject

        public void setObject​(java.io.Serializable object)
                       throws jakarta.jms.JMSException
        Specified by:
        setObject in interface jakarta.jms.ObjectMessage
        Throws:
        jakarta.jms.JMSException
      • getObject

        public java.io.Serializable getObject()
                                       throws jakarta.jms.JMSException
        Specified by:
        getObject in interface jakarta.jms.ObjectMessage
        Throws:
        jakarta.jms.JMSException
      • getObject

        public java.io.Serializable getObject​(java.util.List<java.lang.String> trustedPackages)
                                       throws jakarta.jms.JMSException
        Throws:
        jakarta.jms.JMSException
      • clearBodyInternal

        public void clearBodyInternal()
                               throws jakarta.jms.JMSException
        Specified by:
        clearBodyInternal in class RMQMessage
        Throws:
        jakarta.jms.JMSException
      • writeBody

        protected void writeBody​(java.io.ObjectOutput out,
                                 java.io.ByteArrayOutputStream bout)
                          throws java.io.IOException
        Description copied from class: RMQMessage
        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
        Description copied from class: RMQMessage
        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
      • 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
      • recreate

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

        public static RMQMessage recreate​(RMQObjectMessage msg,
                                          java.util.List<java.lang.String> patterns)
                                   throws jakarta.jms.JMSException
        Throws:
        jakarta.jms.JMSException
      • isBodyAssignableTo

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

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