|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.exolab.jms.message.MessageImpl | +--org.exolab.jms.message.ObjectMessageImpl
This class implements the javax.jms.ObjectMessage
interface.
An ObjectMessage is used to send a message that contains a serializable
Java object. It inherits from Message
and adds a body
containing a single Java reference. Only Serializable
Java
objects can be used.
If a collection of Java objects must be sent, one of the collection classes provided in JDK 1.2 can be used.
When a client receives an ObjectMessage, it is in read-only mode. If a
client attempts to write to the message at this point, a
MessageNotWriteableException is thrown. If clearBody
is
called, the message can now be both read from and written to.
Fields inherited from class org.exolab.jms.message.MessageImpl |
_acceptedTime, _bodyReadOnly, _connectionId, _processed, _propertiesReadOnly, _sequenceNumber, EMPTY |
Fields inherited from interface javax.jms.Message |
DEFAULT_DELIVERY_MODE, DEFAULT_PRIORITY, DEFAULT_TIME_TO_LIVE |
Constructor Summary | |
ObjectMessageImpl()
Construct a new ObjectMessage |
Method Summary | |
void |
clearBody()
Clear out the message body. |
java.lang.Object |
clone()
Clone an instance of this object |
java.io.Serializable |
getObject()
Get the serializable object containing this message's data. |
void |
readExternal(java.io.ObjectInput in)
Serialize in this message's data |
void |
setObject(java.io.Serializable object)
Set the serializable object containing this message's data. |
void |
writeExternal(java.io.ObjectOutput out)
Serialize out this message's data |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, 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 |
Constructor Detail |
public ObjectMessageImpl() throws javax.jms.JMSException
javax.jms.JMSException
- if the message type can't be setMethod Detail |
public final java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class MessageImpl
java.lang.CloneNotSupportedException
- if object or attributes aren't
cloneablepublic final void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in class MessageImpl
out
- the stream to serialize out tojava.io.IOException
- if any I/O exceptions occurrpublic final void readExternal(java.io.ObjectInput in) throws java.lang.ClassNotFoundException, java.io.IOException
readExternal
in class MessageImpl
in
- the stream to serialize in fromjava.lang.ClassNotFoundException
- if the class for an object being
restored cannot be found.java.io.IOException
- if any I/O exceptions occurpublic final void setObject(java.io.Serializable object) throws javax.jms.MessageFormatException, javax.jms.MessageNotWriteableException
ObjectMessage
contains a snapshot of the object at the time setObject()
is called - subsequent modifications of the object will have no
affect on the ObjectMessage
body.setObject
in interface javax.jms.ObjectMessage
object
- the message's datajavax.jms.MessageFormatException
- if object serialization failsjavax.jms.MessageNotWriteableException
- if the message is read-onlypublic final java.io.Serializable getObject() throws javax.jms.MessageFormatException
getObject
in interface javax.jms.ObjectMessage
javax.jms.MessageFormatException
- if object deserialization failspublic final void clearBody() throws javax.jms.JMSException
clearBody
in interface javax.jms.Message
clearBody
in class MessageImpl
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |