|
|||||||||
| Home >> All >> org >> activemq >> [ message overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.activemq.message
Class ActiveMQObjectMessage

java.lang.Objectorg.activemq.message.AbstractPacket
org.activemq.message.ActiveMQMessage
org.activemq.message.ActiveMQObjectMessage
- All Implemented Interfaces:
- BodyPacket, java.lang.Comparable, org.activemq.io.util.MemoryManageable, javax.jms.Message, javax.jms.ObjectMessage, Packet
- public class ActiveMQObjectMessage
- extends ActiveMQMessage
- implements javax.jms.ObjectMessage
- extends ActiveMQMessage
An ObjectMessage object is used to send a message that contains
a serializable object in the Java programming language ("Java object").
It inherits from the Message interface and adds a body
containing a single reference to an object. Only Serializable
Java objects can be used.
If a collection of Java objects must be sent, one of the
Collection classes provided since 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.
| Field Summary | |
private java.io.Serializable |
object
|
| Fields inherited from class org.activemq.message.ActiveMQMessage |
BOOLEAN, BROKER_NAME_INDEX, BYTE, BYTES, CACHED_DESTINATION_INDEX, CACHED_VALUES_INDEX, CHAR, CID_INDEX, CLUSTER_NAME_INDEX, CORRELATION_INDEX, DEFAULT_DELIVERY_MODE, DEFAULT_PRIORITY, DEFAULT_TIME_TO_LIVE, DISPATCHED_FROM_DLQ_INDEX, DOUBLE, EOF, EXPIRATION_INDEX, EXTERNAL_MESSAGE_ID_INDEX, FLOAT, INT, LONG, LONG_SEQUENCE_INDEX, MESSAGE_PART_INDEX, NULL, PAYLOAD_INDEX, PROPERTIES_INDEX, readOnlyMessage, REDELIVERED_INDEX, REPLY_TO_INDEX, SHORT, STRING, TIMESTAMP_INDEX, TRANSACTION_ID_INDEX, TYPE_INDEX, XA_TRANS_INDEX |
| Fields inherited from class org.activemq.message.AbstractPacket |
bitArray, BROKERS_VISITED_INDEX, cachedHashCode, RECEIPT_REQUIRED_INDEX |
| Fields inherited from interface javax.jms.Message |
DEFAULT_DELIVERY_MODE, DEFAULT_PRIORITY, DEFAULT_TIME_TO_LIVE |
| Constructor Summary | |
ActiveMQObjectMessage()
|
|
| Method Summary | |
void |
clearBody()
Clears out the message body. |
protected javax.jms.JMSException |
createFailedToBuildBodyException(java.io.IOException ioe)
|
ActiveMQMessage |
deepCopy()
|
java.io.Serializable |
getObject()
Gets the serializable object containing this message's data. |
int |
getPacketType()
Return the type of Packet |
void |
prepareMessageBody()
Prepare a message body for delivery |
void |
readBody(java.io.DataInput dataIn)
Used to help build the body from an input stream |
void |
setObject(java.io.Serializable newObject)
Sets the serializable object containing this message's data. |
void |
setObjectPayload(java.lang.Object newObject)
|
ActiveMQMessage |
shallowCopy()
|
java.lang.String |
toString()
Convert this Object to a human-readable String. |
void |
writeBody(java.io.DataOutput dataOut)
Used serialize the message body to an output stream |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.activemq.io.util.MemoryManageable |
decrementMemoryReferenceCount, getMemoryUsage, getMemoryUsageReferenceCount, incrementMemoryReferenceCount |
| Field Detail |
object
private java.io.Serializable object
| Constructor Detail |
ActiveMQObjectMessage
public ActiveMQObjectMessage()
| Method Detail |
getPacketType
public int getPacketType()
- Return the type of Packet
- Specified by:
getPacketTypein interfacePacket- Overrides:
getPacketTypein classActiveMQMessage
shallowCopy
public ActiveMQMessage shallowCopy() throws javax.jms.JMSException
- Overrides:
shallowCopyin classActiveMQMessage
deepCopy
public ActiveMQMessage deepCopy() throws javax.jms.JMSException
- Overrides:
deepCopyin classActiveMQMessage
clearBody
public void clearBody()
throws javax.jms.JMSException
- Clears out the message body. Clearing a message's body does not clear
its header values or property entries.
If this message body was read-only, calling this method leaves the message body in the same state as an empty body in a newly created message.
- Specified by:
clearBodyin interfacejavax.jms.Message- Overrides:
clearBodyin classActiveMQMessage
setObject
public void setObject(java.io.Serializable newObject) throws javax.jms.JMSException
- Sets the serializable object containing this message's data.
It is important to note that an
ObjectMessagecontains a snapshot of the object at the timesetObject()is called; subsequent modifications of the object will have no effect on theObjectMessagebody.- Specified by:
setObjectin interfacejavax.jms.ObjectMessage
setObjectPayload
public void setObjectPayload(java.lang.Object newObject)
getObject
public java.io.Serializable getObject() throws javax.jms.JMSException
- Gets the serializable object containing this message's data. The
default value is null.
- Specified by:
getObjectin interfacejavax.jms.ObjectMessage
prepareMessageBody
public void prepareMessageBody()
throws javax.jms.JMSException
- Prepare a message body for delivery
- Overrides:
prepareMessageBodyin classActiveMQMessage
writeBody
public void writeBody(java.io.DataOutput dataOut) throws java.io.IOException
- Used serialize the message body to an output stream
- Specified by:
writeBodyin interfaceBodyPacket- Overrides:
writeBodyin classActiveMQMessage
readBody
public void readBody(java.io.DataInput dataIn) throws java.io.IOException
- Used to help build the body from an input stream
- Specified by:
readBodyin interfaceBodyPacket- Overrides:
readBodyin classActiveMQMessage
toString
public java.lang.String toString()
- Description copied from class:
java.lang.Object - Convert this Object to a human-readable String.
There are no limits placed on how long this String
should be or what it should contain. We suggest you
make it as intuitive as possible to be able to place
it into System.out.println() 55
and such.
It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.
This method will be called when performing string concatenation with this object. If the result is
null, string concatenation will instead use"null".The default implementation returns
getClass().getName() + "@" + Integer.toHexString(hashCode()).- Overrides:
toStringin classActiveMQMessage
createFailedToBuildBodyException
protected javax.jms.JMSException createFailedToBuildBodyException(java.io.IOException ioe)
|
|||||||||
| Home >> All >> org >> activemq >> [ message overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC