public class ActiveMQObjectMessage extends ActiveMQMessage implements ObjectMessage, TransientInitializer
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.
Message.MessageDestination
Modifier and Type | Field and Description |
---|---|
static byte |
DATA_STRUCTURE_TYPE |
protected Serializable |
object |
acknowledgeCallback, BROKER_PATH_PROPERTY, DLQ_DELIVERY_FAILURE_CAUSE_PROPERTY
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
commandId, responseRequired
DEFAULT_DELIVERY_MODE, DEFAULT_PRIORITY, DEFAULT_TIME_TO_LIVE
AMQ_SCHEDULED_CRON, AMQ_SCHEDULED_DELAY, AMQ_SCHEDULED_ID, AMQ_SCHEDULED_PERIOD, AMQ_SCHEDULED_REPEAT, AMQ_SCHEDULER_ACTION, AMQ_SCHEDULER_ACTION_BROWSE, AMQ_SCHEDULER_ACTION_END_TIME, AMQ_SCHEDULER_ACTION_REMOVE, AMQ_SCHEDULER_ACTION_REMOVEALL, AMQ_SCHEDULER_ACTION_START_TIME, AMQ_SCHEDULER_MANAGEMENT_DESTINATION
Constructor and Description |
---|
ActiveMQObjectMessage() |
Modifier and Type | Method and Description |
---|---|
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.
|
List<String> |
getTrustedPackages() |
void |
initTransients() |
boolean |
isTrustAllPackages() |
void |
onMessageRolledBack() |
void |
setObject(Serializable newObject)
Sets the serializable object containing this message's data.
|
void |
setTrustAllPackages(boolean trustAllPackages) |
void |
setTrustedPackages(List<String> trustedPackages) |
void |
storeContent() |
void |
storeContentAndClear() |
String |
toString() |
acknowledge, checkReadOnlyBody, checkValidObject, checkValidScheduled, clearProperties, convertScheduled, copy, decodeString, encodeString, equals, getAcknowledgeCallback, getAllPropertyNames, getBooleanProperty, getByteProperty, getDoubleProperty, getFloatProperty, getIntProperty, getJMSCorrelationID, getJMSCorrelationIDAsBytes, getJMSDeliveryMode, getJMSDestination, getJMSExpiration, getJMSMessageID, getJMSPriority, getJMSRedelivered, getJMSReplyTo, getJMSTimestamp, getJMSType, getLongProperty, getObjectProperty, getPropertyNames, getShortProperty, getStringProperty, hashCode, onSend, propertyExists, setAcknowledgeCallback, setBooleanProperty, setBooleanProperty, setByteProperty, setDoubleProperty, setFloatProperty, setIntProperty, setJMSCorrelationID, setJMSCorrelationIDAsBytes, setJMSDeliveryMode, setJMSDestination, setJMSExpiration, setJMSMessageID, setJMSMessageID, setJMSPriority, setJMSRedelivered, setJMSReplyTo, setJMSTimestamp, setJMSType, setLongProperty, setObjectProperty, setObjectProperty, setProperties, setShortProperty, setStringProperty, visit
afterMarshall, afterUnmarshall, beforeUnmarshall, canProcessAsExpired, copy, decrementReferenceCount, doCompress, getArrival, getBrokerInTime, getBrokerOutTime, getBrokerPath, getCluster, getConnection, getContent, getCorrelationId, getDataStructure, getDestination, getExpiration, getGroupID, getGroupSequence, getMarshalledProperties, getMemoryUsage, getMessage, getMessageHardRef, getMessageId, getMinimumMessageSize, getOriginalDestination, getOriginalTransactionId, getPriority, getProducerId, getProperties, getProperty, getRedeliveryCounter, getReferenceCount, getRegionDestination, getReplyTo, getSize, getTargetConsumerId, getTimestamp, getTransactionId, getType, getUserID, incrementRedeliveryCounter, incrementReferenceCount, isAdvisory, isCompressed, isDroppable, isDropped, isExpired, isInTransaction, isJMSXGroupFirstForConsumer, isMarshallAware, isMessage, isPersistent, isReadOnlyBody, isReadOnlyProperties, isRecievedByDFBridge, isRedelivered, lazyCreateProperties, removeProperty, setArrival, setBrokerInTime, setBrokerOutTime, setBrokerPath, setCluster, setCompressed, setConnection, setContent, setCorrelationId, setDataStructure, setDestination, setDroppable, setExpiration, setGroupID, setGroupSequence, setJMSXGroupFirstForConsumer, setMarshalledProperties, setMemoryUsage, setMessageId, setOriginalDestination, setOriginalTransactionId, setPersistent, setPriority, setProducerId, setProperty, setReadOnlyBody, setReadOnlyProperties, setRecievedByDFBridge, setRedelivered, setRedeliveryCounter, setRegionDestination, setReplyTo, setTargetConsumerId, setTimestamp, setTransactionId, setType, setUserID, toString
copy, getCommandId, getFrom, getTo, isBrokerInfo, isConnectionControl, isConsumerControl, isMessageAck, isMessageDispatch, isMessageDispatchNotification, isResponse, isResponseRequired, isShutdownInfo, isWireFormatInfo, setCommandId, setFrom, setResponseRequired, setTo
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
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
public static final byte DATA_STRUCTURE_TYPE
protected transient Serializable object
public ActiveMQObjectMessage()
public Message copy()
copy
in class ActiveMQMessage
public void storeContentAndClear()
storeContentAndClear
in class ActiveMQMessage
public void storeContent()
storeContent
in class ActiveMQMessage
public byte getDataStructureType()
getDataStructureType
in interface DataStructure
getDataStructureType
in class ActiveMQMessage
public String getJMSXMimeType()
Message
BlobMessage
it allows you to create a selector on the MIME type of the BLOB bodygetJMSXMimeType
in class ActiveMQMessage
public void clearBody() throws 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 Message
clearBody
in class ActiveMQMessage
JMSException
- if the JMS provider fails to clear the message body
due to some internal error.public void setObject(Serializable newObject) throws 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 ObjectMessage
newObject
- the message's dataJMSException
- if the JMS provider fails to set the object due to
some internal error.MessageFormatException
- if object serialization fails.MessageNotWriteableException
- if the message is in
read-only mode.public Serializable getObject() throws JMSException
getObject
in interface ObjectMessage
JMSException
public void beforeMarshall(WireFormat wireFormat) throws IOException
beforeMarshall
in interface MarshallAware
beforeMarshall
in class Message
IOException
public void clearMarshalledState() throws JMSException
clearMarshalledState
in class Message
JMSException
public void onMessageRolledBack()
onMessageRolledBack
in class Message
public void compress() throws IOException
compress
in class Message
IOException
public List<String> getTrustedPackages()
public void setTrustedPackages(List<String> trustedPackages)
public boolean isTrustAllPackages()
public void setTrustAllPackages(boolean trustAllPackages)
public void initTransients()
initTransients
in interface TransientInitializer
Copyright © 2005–2016 FuseSource, Corp.. All rights reserved.