Package com.swiftmq.jms
Class ObjectMessageImpl
- java.lang.Object
-
- com.swiftmq.jms.MessageImpl
-
- com.swiftmq.jms.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 methodgetObject(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
-
-
Field Summary
-
Fields inherited from class com.swiftmq.jms.MessageImpl
DEFAULT_PRIORITY, MAX_PRIORITY, MIN_PRIORITY, PROP_CLIENT_ID, PROP_DELIVERY_COUNT, PROP_DOUBT_DUPLICATE, PROP_UNROUTABLE_REASON, PROP_USER_ID
-
-
Constructor Summary
Constructors Constructor Description ObjectMessageImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearBody()
Clear out the message body.java.io.Serializable
getObject()
Get the serializable object containing this message's data.java.io.Serializable
getObject(java.lang.ClassLoader customLoader)
Get the serializable object containing this message's data.protected int
getType()
boolean
isUseThreadContextCL()
protected void
readBody(java.io.DataInput in)
void
setObject(java.io.Serializable obj)
Set the serializable object containing this message's data.void
setReadOnly(boolean b)
void
setUseThreadContextCL(boolean useThreadContextCL)
java.lang.String
toString()
protected void
writeBody(java.io.DataOutput out)
-
Methods inherited from class com.swiftmq.jms.MessageImpl
acknowledge, clearProperties, clearSwiftMQAllProps, clearSwiftMQProps, createInstance, getBooleanProperty, getByteProperty, getDestQueue, getDestRouter, getDoubleProperty, getDuplicateId, getField, getFloatProperty, getIntProperty, getJMSCorrelationID, getJMSCorrelationIDAsBytes, getJMSDeliveryMode, getJMSDestination, getJMSExpiration, getJMSMessageID, getJMSPriority, getJMSRedelivered, getJMSReplyTo, getJMSTimestamp, getJMSType, getLongProperty, getMessageIndex, getMessageLength, getObjectProperty, getPersistentKey, getPropertyNames, getShortProperty, getSourceRouter, getStreamPKey, getStringProperty, isCancelled, propertyExists, readContent, readContent, removeProperty, reset, setBooleanProperty, setByteProperty, setDestQueue, setDestRouter, setDoubleProperty, setDuplicateId, setFloatProperty, setIntProperty, setJMSCorrelationID, setJMSCorrelationIDAsBytes, setJMSDeliveryMode, setJMSDestination, setJMSExpiration, setJMSMessageID, setJMSPriority, setJMSRedelivered, setJMSReplyTo, setJMSTimestamp, setJMSType, setLongProperty, setMessageConsumerImpl, setMessageIndex, setObjectProperty, setPersistentKey, setSessionImpl, setShortProperty, setSourceRouter, setStreamPKey, setStringProperty, unfoldBody, unfoldBuffers, writeContent, writeContent
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface javax.jms.Message
acknowledge, clearProperties, getBooleanProperty, getByteProperty, getDoubleProperty, getFloatProperty, getIntProperty, getJMSCorrelationID, getJMSCorrelationIDAsBytes, getJMSDeliveryMode, getJMSDestination, getJMSExpiration, getJMSMessageID, getJMSPriority, getJMSRedelivered, getJMSReplyTo, getJMSTimestamp, getJMSType, getLongProperty, getObjectProperty, getPropertyNames, getShortProperty, getStringProperty, propertyExists, setBooleanProperty, setByteProperty, setDoubleProperty, setFloatProperty, setIntProperty, setJMSCorrelationID, setJMSCorrelationIDAsBytes, setJMSDeliveryMode, setJMSDestination, setJMSExpiration, setJMSMessageID, setJMSPriority, setJMSRedelivered, setJMSReplyTo, setJMSTimestamp, setJMSType, setLongProperty, setObjectProperty, setShortProperty, setStringProperty
-
-
-
-
Method Detail
-
getType
protected int getType()
- Overrides:
getType
in classMessageImpl
-
writeBody
protected void writeBody(java.io.DataOutput out) throws java.io.IOException
- Overrides:
writeBody
in classMessageImpl
- Throws:
java.io.IOException
-
readBody
protected void readBody(java.io.DataInput in) throws java.io.IOException
- Overrides:
readBody
in classMessageImpl
- Throws:
java.io.IOException
-
isUseThreadContextCL
public boolean isUseThreadContextCL()
-
setUseThreadContextCL
public void setUseThreadContextCL(boolean useThreadContextCL)
- Overrides:
setUseThreadContextCL
in classMessageImpl
-
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
-
setReadOnly
public void setReadOnly(boolean b)
- Overrides:
setReadOnly
in classMessageImpl
-
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 interfacejavax.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 interfacejavax.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 failsjavax.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 interfacejavax.jms.Message
- Overrides:
clearBody
in classMessageImpl
- Throws:
javax.jms.JMSException
- if JMS fails to due to some internal JMS error.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classMessageImpl
-
-