Class AmqpJmsObjectMessageFacade

java.lang.Object
org.apache.qpid.jms.provider.amqp.message.AmqpJmsMessageFacade
org.apache.qpid.jms.provider.amqp.message.AmqpJmsObjectMessageFacade
All Implemented Interfaces:
JmsMessageFacade, JmsObjectMessageFacade, TraceableMessage

public class AmqpJmsObjectMessageFacade extends AmqpJmsMessageFacade implements JmsObjectMessageFacade
Wrapper around an AMQP Message instance that will be treated as a JMS ObjectMessage type.
  • Constructor Details

    • AmqpJmsObjectMessageFacade

      public AmqpJmsObjectMessageFacade()
  • Method Details

    • initialize

      public void initialize(AmqpConnection connection)
      Description copied from class: AmqpJmsMessageFacade
      Initialize the state of this message for send.
      Overrides:
      initialize in class AmqpJmsMessageFacade
      Parameters:
      connection - The connection that this message is linked to.
    • initialize

      public void initialize(AmqpConsumer consumer)
      Description copied from class: AmqpJmsMessageFacade
      Initialize the state of this message for receive.
      Overrides:
      initialize in class AmqpJmsMessageFacade
      Parameters:
      consumer - The consumer that this message was read from.
    • getJmsMsgType

      public byte getJmsMsgType()
      Overrides:
      getJmsMsgType in class AmqpJmsMessageFacade
      Returns:
      the appropriate byte value that indicates the type of message this is.
    • isAmqpTypedEncoding

      public boolean isAmqpTypedEncoding()
    • copy

      public AmqpJmsObjectMessageFacade copy() throws jakarta.jms.JMSException
      Description copied from interface: JmsMessageFacade
      Create a new instance and perform a deep copy of this object's contents.
      Specified by:
      copy in interface JmsMessageFacade
      Specified by:
      copy in interface JmsObjectMessageFacade
      Overrides:
      copy in class AmqpJmsMessageFacade
      Returns:
      a copy of this JmsMessageFacade instance.
      Throws:
      jakarta.jms.JMSException - if an error occurs while copying the message.
    • getObject

      public Serializable getObject() throws IOException, ClassNotFoundException
      Description copied from interface: JmsObjectMessageFacade
      Gets the Object value that is contained in the provider message. If the Object is stored in some serialized form then the Provider must de-serialize the object prior to returning it.
      Specified by:
      getObject in interface JmsObjectMessageFacade
      Returns:
      the de-serialized version of the contained object.
      Throws:
      IOException - if the provider fails to get the object due to some internal error.
      ClassNotFoundException - if object de-serialization fails because the ClassLoader cannot find the Class locally.
    • setObject

      public void setObject(Serializable value) throws IOException
      Description copied from interface: JmsObjectMessageFacade
      Stores the given object into the provider Message. In order for the provider to be fully JMS compliant the set Object should be immediately serialized and stored so that future modifications to the object are not reflected in the stored version of the object.
      Specified by:
      setObject in interface JmsObjectMessageFacade
      Parameters:
      value - the new value to write to the provider message.
      Throws:
      IOException - if the provider fails to store the object due to some internal error.
    • clearBody

      public void clearBody()
      Description copied from interface: JmsMessageFacade
      Clears the contents of this Message.
      Specified by:
      clearBody in interface JmsMessageFacade
      Overrides:
      clearBody in class AmqpJmsMessageFacade
    • hasBody

      public boolean hasBody()
      Description copied from interface: JmsMessageFacade
      Returns true if the underlying message has a body, false if the body is empty.
      Specified by:
      hasBody in interface JmsMessageFacade
      Overrides:
      hasBody in class AmqpJmsMessageFacade
      Returns:
      true if the underlying message has a body, false if the body is empty.
    • onSend

      public void onSend(long producerTtl) throws jakarta.jms.JMSException
      Description copied from interface: JmsMessageFacade
      Called before a message is sent to allow a Message instance to move the contents from a logical data structure to a binary form for transmission, or other processing such as setting proper message headers etc. The method allows for passing through producer configuration details not explicitly mapped into the JMS Message allowing the facade to create the most correct and compact message on the wire.
      Specified by:
      onSend in interface JmsMessageFacade
      Overrides:
      onSend in class AmqpJmsMessageFacade
      Parameters:
      producerTtl - the time to live value configured on the producer when sent.
      Throws:
      jakarta.jms.JMSException - if an error occurs while preparing the message for send.
    • asJmsMessage

      public JmsObjectMessage asJmsMessage()
      Overrides:
      asJmsMessage in class AmqpJmsMessageFacade