|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.activemq.command.BaseCommand
org.apache.activemq.command.Message
org.apache.activemq.command.ActiveMQMessage
org.apache.activemq.command.ActiveMQObjectMessage
public class ActiveMQObjectMessage
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.
Session.createObjectMessage(),
Session.createObjectMessage(Serializable),
BytesMessage,
MapMessage,
Message,
StreamMessage,
TextMessage| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.apache.activemq.command.Message |
|---|
Message.MessageDestination |
| Field Summary | |
|---|---|
static byte |
DATA_STRUCTURE_TYPE
|
protected Serializable |
object
|
| Fields inherited from class org.apache.activemq.command.ActiveMQMessage |
|---|
acknowledgeCallback, BROKER_PATH_PROPERTY, DLQ_DELIVERY_FAILURE_CAUSE_PROPERTY |
| Fields inherited from class org.apache.activemq.command.Message |
|---|
arrival, brokerInTime, brokerOutTime, compressed, content, correlationId, dataStructure, DEFAULT_MINIMUM_MESSAGE_SIZE, destination, droppable, expiration, groupID, groupSequence, jmsXGroupFirstForConsumer, marshalledProperties, messageId, ORIGINAL_EXPIRATION, originalDestination, originalTransactionId, persistent, priority, producerId, properties, readOnlyBody, readOnlyProperties, recievedByDFBridge, redeliveryCounter, replyTo, size, targetConsumerId, timestamp, transactionId, type, userID |
| Fields inherited from class org.apache.activemq.command.BaseCommand |
|---|
commandId, responseRequired |
| Fields inherited from interface javax.jms.Message |
|---|
DEFAULT_DELIVERY_MODE, DEFAULT_PRIORITY, DEFAULT_TIME_TO_LIVE |
| Constructor Summary | |
|---|---|
ActiveMQObjectMessage()
|
|
| Method Summary | |
|---|---|
void |
beforeMarshall(WireFormat wireFormat)
|
void |
clearBody()
Clears out the message body. |
void |
clearMarshalledState()
|
void |
compress()
|
Message |
copy()
|
byte |
getDataStructureType()
|
String |
getJMSXMimeType()
Returns the MIME type of this mesage. |
Serializable |
getObject()
Gets the serializable object containing this message's data. |
void |
onMessageRolledBack()
|
void |
setObject(Serializable newObject)
Sets the serializable object containing this message's data. |
void |
storeContent()
|
void |
storeContentAndClear()
|
String |
toString()
|
| Methods inherited from class org.apache.activemq.command.BaseCommand |
|---|
copy, getCommandId, getFrom, getTo, isBrokerInfo, isConnectionControl, isMessageAck, isMessageDispatch, isMessageDispatchNotification, isResponse, isResponseRequired, isShutdownInfo, isWireFormatInfo, setCommandId, setFrom, setResponseRequired, setTo |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, 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 |
| Field Detail |
|---|
public static final byte DATA_STRUCTURE_TYPE
protected transient Serializable object
| Constructor Detail |
|---|
public ActiveMQObjectMessage()
| Method Detail |
|---|
public Message copy()
copy in class ActiveMQMessagepublic void storeContentAndClear()
storeContentAndClear in class ActiveMQMessagepublic void storeContent()
storeContent in class ActiveMQMessagepublic byte getDataStructureType()
getDataStructureType in interface DataStructuregetDataStructureType in class ActiveMQMessagepublic String getJMSXMimeType()
MessageBlobMessage
it allows you to create a selector on the MIME type of the BLOB body
getJMSXMimeType in class ActiveMQMessage
public void clearBody()
throws javax.jms.JMSException
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.
clearBody in interface javax.jms.MessageclearBody in class ActiveMQMessagejavax.jms.JMSException - if the JMS provider fails to clear the message body
due to some internal error.
public void setObject(Serializable newObject)
throws javax.jms.JMSException
ObjectMessage contains a
snapshot of the object at the time setObject() is called;
subsequent modifications of the object will have no effect on the
ObjectMessage body.
setObject in interface javax.jms.ObjectMessagenewObject - the message's data
javax.jms.JMSException - if the JMS provider fails to set the object due to
some internal error.
javax.jms.MessageFormatException - if object serialization fails.
javax.jms.MessageNotWriteableException - if the message is in
read-only mode.
public Serializable getObject()
throws javax.jms.JMSException
getObject in interface javax.jms.ObjectMessagejavax.jms.JMSException
public void beforeMarshall(WireFormat wireFormat)
throws IOException
beforeMarshall in interface MarshallAwarebeforeMarshall in class MessageIOException
public void clearMarshalledState()
throws javax.jms.JMSException
clearMarshalledState in class Messagejavax.jms.JMSExceptionpublic void onMessageRolledBack()
onMessageRolledBack in class Message
public void compress()
throws IOException
compress in class MessageIOExceptionpublic String toString()
toString in class Message
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||