Class ObjectMessageImpl

  • All Implemented Interfaces:
    java.io.Serializable, javax.jms.Message, javax.jms.ObjectMessage

    public class ObjectMessageImpl
    extends MessageImpl
    implements javax.jms.ObjectMessage
    Implementation of a ObjectMessage. There is one additional method getObject(classLoader) which must be used by Extension Swiftlet, passing their own classloader to construct the object. This is required due to hot deployment of Extension Swiftlets and different class loaders.
    Author:
    IIT GmbH, Bremen/Germany, Copyright (c) 2000-2002, All Rights Reserved
    See Also:
    Serialized Form
    • Constructor Detail

      • ObjectMessageImpl

        public ObjectMessageImpl()
    • Method Detail

      • writeBody

        protected void writeBody​(java.io.DataOutput out)
                          throws java.io.IOException
        Overrides:
        writeBody in class MessageImpl
        Throws:
        java.io.IOException
      • readBody

        protected void readBody​(java.io.DataInput in)
                         throws java.io.IOException
        Overrides:
        readBody in class MessageImpl
        Throws:
        java.io.IOException
      • isUseThreadContextCL

        public boolean isUseThreadContextCL()
      • getObject

        public java.io.Serializable getObject​(java.lang.ClassLoader customLoader)
                                       throws javax.jms.JMSException
        Get the serializable object containing this message's data. The default value is null.
        Parameters:
        customLoader - a custom class loader to load the class
        Returns:
        the serializable object containing this message's data
        Throws:
        javax.jms.JMSException - if JMS fails to get object due to some internal JMS error.
        MessageFormatException - if object deserialization fails
      • getObject

        public java.io.Serializable getObject()
                                       throws javax.jms.JMSException
        Get the serializable object containing this message's data. The default value is null.
        Specified by:
        getObject in interface javax.jms.ObjectMessage
        Returns:
        the serializable object containing this message's data
        Throws:
        javax.jms.JMSException - if JMS fails to get object due to some internal JMS error.
        MessageFormatException - if object deserialization fails
      • setObject

        public void setObject​(java.io.Serializable obj)
                       throws javax.jms.JMSException
        Set the serializable object containing this message's data.
        Specified by:
        setObject in interface javax.jms.ObjectMessage
        Parameters:
        object - the message's data
        Throws:
        javax.jms.JMSException - if JMS fails to set object due to some internal JMS error.
        MessageFormatException - if object serialization fails
        javax.jms.MessageNotWriteableException - if message in read-only mode.
      • clearBody

        public void clearBody()
                       throws javax.jms.JMSException
        Clear out the message body. All other parts of the message are left untouched.
        Specified by:
        clearBody in interface javax.jms.Message
        Overrides:
        clearBody in class MessageImpl
        Throws:
        javax.jms.JMSException - if JMS fails to due to some internal JMS error.