Class AmqpSerializedObjectDelegate

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void copyInto​(AmqpObjectTypeDelegate copy)
      Copy the internal data into the given instance.
      java.io.Serializable getObject()
      Read a Serialized object from the AMQP message using the strategy implemented by this delegate.
      boolean hasBody()  
      boolean isAmqpTypeEncoded()  
      boolean isTrusted​(java.lang.Class<?> clazz)  
      void onSend()
      Signals that the message is about to be sent so we should ensure proper state of the marshaled object and message annotations prior to that.
      void setObject​(java.io.Serializable value)
      Given a serializable instance, store the value into the AMQP message using the strategy implemented by this delegate.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AmqpSerializedObjectDelegate

        public AmqpSerializedObjectDelegate​(AmqpJmsMessageFacade parent,
                                            JmsDeserializationPolicy deserializationPolicy)
        Create a new delegate that uses Java serialization to store the message content.
        Parameters:
        parent - the AMQP message facade instance where the object is to be stored / read.
        deserializationPolicy - the JmsDeserializationPolicy that is used to validate the security of message content, may be null (e.g on new outgoing messages).
    • Method Detail

      • getObject

        public java.io.Serializable getObject()
                                       throws java.io.IOException,
                                              java.lang.ClassNotFoundException
        Description copied from interface: AmqpObjectTypeDelegate
        Read a Serialized object from the AMQP message using the strategy implemented by this delegate.
        Specified by:
        getObject in interface AmqpObjectTypeDelegate
        Returns:
        an Object that has been read from the stored object data in the message.
        Throws:
        java.io.IOException - if an error occurs while reading the stored object.
        java.lang.ClassNotFoundException - if no class can be found for the stored type.
      • setObject

        public void setObject​(java.io.Serializable value)
                       throws java.io.IOException
        Description copied from interface: AmqpObjectTypeDelegate
        Given a serializable instance, store the value into the AMQP message using the strategy implemented by this delegate.
        Specified by:
        setObject in interface AmqpObjectTypeDelegate
        Parameters:
        value - A serializable object instance to be stored in the message.
        Throws:
        java.io.IOException - if an error occurs during the store operation.
      • onSend

        public void onSend()
        Description copied from interface: AmqpObjectTypeDelegate
        Signals that the message is about to be sent so we should ensure proper state of the marshaled object and message annotations prior to that.
        Specified by:
        onSend in interface AmqpObjectTypeDelegate
      • copyInto

        public void copyInto​(AmqpObjectTypeDelegate copy)
                      throws java.lang.Exception
        Description copied from interface: AmqpObjectTypeDelegate
        Copy the internal data into the given instance.
        Specified by:
        copyInto in interface AmqpObjectTypeDelegate
        Parameters:
        copy - the new delegate that will receive a copy of this instances object data.
        Throws:
        java.lang.Exception - if an error occurs while copying the contents to the target.