Package org.apache.activemq.command
Class ActiveMQMessage
- java.lang.Object
-
- org.apache.activemq.command.BaseCommand
-
- org.apache.activemq.command.Message
-
- org.apache.activemq.command.ActiveMQMessage
-
- All Implemented Interfaces:
Message
,MessageReference
,Command
,DataStructure
,MarshallAware
,Message
,ScheduledMessage
- Direct Known Subclasses:
ActiveMQBlobMessage
,ActiveMQBytesMessage
,ActiveMQMapMessage
,ActiveMQObjectMessage
,ActiveMQStreamMessage
,ActiveMQTextMessage
public class ActiveMQMessage extends Message implements Message, ScheduledMessage
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.activemq.command.Message
Message.MessageDestination
-
-
Field Summary
Fields Modifier and Type Field Description protected Callback
acknowledgeCallback
static String
BROKER_PATH_PROPERTY
static byte
DATA_STRUCTURE_TYPE
static String
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
-
Fields inherited from interface org.apache.activemq.ScheduledMessage
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 Summary
Constructors Constructor Description ActiveMQMessage()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
acknowledge()
protected void
checkReadOnlyBody()
protected void
checkReadOnlyProperties()
protected void
checkValidObject(Object value)
void
clearBody()
void
clearProperties()
protected Object
convertScheduled(String name, Object value)
Message
copy()
protected void
copy(ActiveMQMessage copy)
protected static String
decodeString(byte[] data)
protected static byte[]
encodeString(String data)
boolean
equals(Object o)
Callback
getAcknowledgeCallback()
Enumeration
getAllPropertyNames()
return all property names, including standard JMS properties and JMSX propertiesboolean
getBooleanProperty(String name)
byte
getByteProperty(String name)
byte
getDataStructureType()
double
getDoubleProperty(String name)
float
getFloatProperty(String name)
int
getIntProperty(String name)
String
getJMSCorrelationID()
byte[]
getJMSCorrelationIDAsBytes()
int
getJMSDeliveryMode()
Destination
getJMSDestination()
long
getJMSExpiration()
String
getJMSMessageID()
int
getJMSPriority()
boolean
getJMSRedelivered()
Destination
getJMSReplyTo()
long
getJMSTimestamp()
String
getJMSType()
String
getJMSXMimeType()
Returns the MIME type of this mesage.long
getLongProperty(String name)
Object
getObjectProperty(String name)
Enumeration
getPropertyNames()
short
getShortProperty(String name)
String
getStringProperty(String name)
int
hashCode()
protected boolean
isContentMarshalled()
void
onSend()
Send operation event listener.boolean
propertyExists(String name)
void
setAcknowledgeCallback(Callback acknowledgeCallback)
void
setBooleanProperty(String name, boolean value)
void
setBooleanProperty(String name, boolean value, boolean checkReadOnly)
void
setByteProperty(String name, byte value)
void
setDoubleProperty(String name, double value)
void
setFloatProperty(String name, float value)
void
setIntProperty(String name, int value)
void
setJMSCorrelationID(String correlationId)
void
setJMSCorrelationIDAsBytes(byte[] correlationId)
void
setJMSDeliveryMode(int mode)
void
setJMSDestination(Destination destination)
void
setJMSExpiration(long expiration)
void
setJMSMessageID(String value)
Seems to be invalid because the parameter doesn't initialize MessageId instance variables ProducerId and ProducerSequenceIdvoid
setJMSMessageID(ProducerId producerId, long producerSequenceId)
This will create an object of MessageId.void
setJMSPriority(int priority)
void
setJMSRedelivered(boolean redelivered)
void
setJMSReplyTo(Destination destination)
void
setJMSTimestamp(long timestamp)
void
setJMSType(String type)
void
setLongProperty(String name, long value)
void
setObjectProperty(String name, Object value)
void
setObjectProperty(String name, Object value, boolean checkReadOnly)
void
setProperties(Map<String,?> properties)
void
setShortProperty(String name, short value)
void
setStringProperty(String name, String value)
void
storeContent()
void
storeContentAndClear()
Response
visit(CommandVisitor visitor)
-
Methods inherited from class org.apache.activemq.command.Message
afterMarshall, afterUnmarshall, beforeMarshall, beforeUnmarshall, canProcessAsExpired, clearUnMarshalledState, compress, 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, isMarshalled, isMessage, isPersistent, isPropertiesMarshalled, isReadOnlyBody, isReadOnlyProperties, isRecievedByDFBridge, isRedelivered, lazyCreateProperties, onMessageRolledBack, 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, toString
-
Methods inherited from class org.apache.activemq.command.BaseCommand
copy, getCommandId, getFrom, getTo, isBrokerInfo, isConnectionControl, isConsumerControl, isMessageAck, isMessageDispatch, isMessageDispatchNotification, isResponse, isResponseRequired, isShutdownInfo, isWireFormatInfo, setCommandId, setFrom, setResponseRequired, setTo
-
-
-
-
Field Detail
-
DATA_STRUCTURE_TYPE
public static final byte DATA_STRUCTURE_TYPE
- See Also:
- Constant Field Values
-
DLQ_DELIVERY_FAILURE_CAUSE_PROPERTY
public static final String DLQ_DELIVERY_FAILURE_CAUSE_PROPERTY
- See Also:
- Constant Field Values
-
BROKER_PATH_PROPERTY
public static final String BROKER_PATH_PROPERTY
- See Also:
- Constant Field Values
-
acknowledgeCallback
protected transient Callback acknowledgeCallback
-
-
Method Detail
-
getDataStructureType
public byte getDataStructureType()
- Specified by:
getDataStructureType
in interfaceDataStructure
- Returns:
- The type of the data structure
-
copy
protected void copy(ActiveMQMessage copy)
-
acknowledge
public void acknowledge() throws JMSException
- Specified by:
acknowledge
in interfaceMessage
- Throws:
JMSException
-
clearBody
public void clearBody() throws JMSException
- Specified by:
clearBody
in interfaceMessage
- Specified by:
clearBody
in classMessage
- Throws:
JMSException
-
getJMSMessageID
public String getJMSMessageID()
- Specified by:
getJMSMessageID
in interfaceMessage
-
setJMSMessageID
public void setJMSMessageID(String value) throws JMSException
Seems to be invalid because the parameter doesn't initialize MessageId instance variables ProducerId and ProducerSequenceId- Specified by:
setJMSMessageID
in interfaceMessage
- Parameters:
value
-- Throws:
JMSException
-
setJMSMessageID
public void setJMSMessageID(ProducerId producerId, long producerSequenceId) throws JMSException
This will create an object of MessageId. For it to be valid, the instance variable ProducerId and producerSequenceId must be initialized.- Parameters:
producerId
-producerSequenceId
-- Throws:
JMSException
-
getJMSTimestamp
public long getJMSTimestamp()
- Specified by:
getJMSTimestamp
in interfaceMessage
-
setJMSTimestamp
public void setJMSTimestamp(long timestamp)
- Specified by:
setJMSTimestamp
in interfaceMessage
-
getJMSCorrelationID
public String getJMSCorrelationID()
- Specified by:
getJMSCorrelationID
in interfaceMessage
-
setJMSCorrelationID
public void setJMSCorrelationID(String correlationId)
- Specified by:
setJMSCorrelationID
in interfaceMessage
-
getJMSCorrelationIDAsBytes
public byte[] getJMSCorrelationIDAsBytes() throws JMSException
- Specified by:
getJMSCorrelationIDAsBytes
in interfaceMessage
- Throws:
JMSException
-
setJMSCorrelationIDAsBytes
public void setJMSCorrelationIDAsBytes(byte[] correlationId) throws JMSException
- Specified by:
setJMSCorrelationIDAsBytes
in interfaceMessage
- Throws:
JMSException
-
getJMSXMimeType
public String getJMSXMimeType()
Description copied from interface:Message
Returns the MIME type of this mesage. This can be used in selectors to filter on the MIME types of the different JMS messages, or in the case ofBlobMessage
it allows you to create a selector on the MIME type of the BLOB body- Specified by:
getJMSXMimeType
in interfaceMessage
-
decodeString
protected static String decodeString(byte[] data) throws JMSException
- Throws:
JMSException
-
encodeString
protected static byte[] encodeString(String data) throws JMSException
- Throws:
JMSException
-
getJMSReplyTo
public Destination getJMSReplyTo()
- Specified by:
getJMSReplyTo
in interfaceMessage
-
setJMSReplyTo
public void setJMSReplyTo(Destination destination) throws JMSException
- Specified by:
setJMSReplyTo
in interfaceMessage
- Throws:
JMSException
-
getJMSDestination
public Destination getJMSDestination()
- Specified by:
getJMSDestination
in interfaceMessage
-
setJMSDestination
public void setJMSDestination(Destination destination) throws JMSException
- Specified by:
setJMSDestination
in interfaceMessage
- Throws:
JMSException
-
getJMSDeliveryMode
public int getJMSDeliveryMode()
- Specified by:
getJMSDeliveryMode
in interfaceMessage
-
setJMSDeliveryMode
public void setJMSDeliveryMode(int mode)
- Specified by:
setJMSDeliveryMode
in interfaceMessage
-
getJMSRedelivered
public boolean getJMSRedelivered()
- Specified by:
getJMSRedelivered
in interfaceMessage
-
setJMSRedelivered
public void setJMSRedelivered(boolean redelivered)
- Specified by:
setJMSRedelivered
in interfaceMessage
-
getJMSType
public String getJMSType()
- Specified by:
getJMSType
in interfaceMessage
-
setJMSType
public void setJMSType(String type)
- Specified by:
setJMSType
in interfaceMessage
-
getJMSExpiration
public long getJMSExpiration()
- Specified by:
getJMSExpiration
in interfaceMessage
-
setJMSExpiration
public void setJMSExpiration(long expiration)
- Specified by:
setJMSExpiration
in interfaceMessage
-
getJMSPriority
public int getJMSPriority()
- Specified by:
getJMSPriority
in interfaceMessage
-
setJMSPriority
public void setJMSPriority(int priority)
- Specified by:
setJMSPriority
in interfaceMessage
-
clearProperties
public void clearProperties()
- Specified by:
clearProperties
in interfaceMessage
- Overrides:
clearProperties
in classMessage
-
propertyExists
public boolean propertyExists(String name) throws JMSException
- Specified by:
propertyExists
in interfaceMessage
- Throws:
JMSException
-
getPropertyNames
public Enumeration getPropertyNames() throws JMSException
- Specified by:
getPropertyNames
in interfaceMessage
- Throws:
JMSException
-
getAllPropertyNames
public Enumeration getAllPropertyNames() throws JMSException
return all property names, including standard JMS properties and JMSX properties- Returns:
- Enumeration of all property names on this message
- Throws:
JMSException
-
setObjectProperty
public void setObjectProperty(String name, Object value) throws JMSException
- Specified by:
setObjectProperty
in interfaceMessage
- Throws:
JMSException
-
setObjectProperty
public void setObjectProperty(String name, Object value, boolean checkReadOnly) throws JMSException
- Throws:
JMSException
-
setProperties
public void setProperties(Map<String,?> properties) throws JMSException
- Throws:
JMSException
-
checkValidObject
protected void checkValidObject(Object value) throws MessageFormatException
- Throws:
MessageFormatException
-
convertScheduled
protected Object convertScheduled(String name, Object value) throws MessageFormatException
- Throws:
MessageFormatException
-
getObjectProperty
public Object getObjectProperty(String name) throws JMSException
- Specified by:
getObjectProperty
in interfaceMessage
- Throws:
JMSException
-
getBooleanProperty
public boolean getBooleanProperty(String name) throws JMSException
- Specified by:
getBooleanProperty
in interfaceMessage
- Throws:
JMSException
-
getByteProperty
public byte getByteProperty(String name) throws JMSException
- Specified by:
getByteProperty
in interfaceMessage
- Throws:
JMSException
-
getShortProperty
public short getShortProperty(String name) throws JMSException
- Specified by:
getShortProperty
in interfaceMessage
- Throws:
JMSException
-
getIntProperty
public int getIntProperty(String name) throws JMSException
- Specified by:
getIntProperty
in interfaceMessage
- Throws:
JMSException
-
getLongProperty
public long getLongProperty(String name) throws JMSException
- Specified by:
getLongProperty
in interfaceMessage
- Throws:
JMSException
-
getFloatProperty
public float getFloatProperty(String name) throws JMSException
- Specified by:
getFloatProperty
in interfaceMessage
- Throws:
JMSException
-
getDoubleProperty
public double getDoubleProperty(String name) throws JMSException
- Specified by:
getDoubleProperty
in interfaceMessage
- Throws:
JMSException
-
getStringProperty
public String getStringProperty(String name) throws JMSException
- Specified by:
getStringProperty
in interfaceMessage
- Throws:
JMSException
-
setBooleanProperty
public void setBooleanProperty(String name, boolean value) throws JMSException
- Specified by:
setBooleanProperty
in interfaceMessage
- Throws:
JMSException
-
setBooleanProperty
public void setBooleanProperty(String name, boolean value, boolean checkReadOnly) throws JMSException
- Throws:
JMSException
-
setByteProperty
public void setByteProperty(String name, byte value) throws JMSException
- Specified by:
setByteProperty
in interfaceMessage
- Throws:
JMSException
-
setShortProperty
public void setShortProperty(String name, short value) throws JMSException
- Specified by:
setShortProperty
in interfaceMessage
- Throws:
JMSException
-
setIntProperty
public void setIntProperty(String name, int value) throws JMSException
- Specified by:
setIntProperty
in interfaceMessage
- Throws:
JMSException
-
setLongProperty
public void setLongProperty(String name, long value) throws JMSException
- Specified by:
setLongProperty
in interfaceMessage
- Throws:
JMSException
-
setFloatProperty
public void setFloatProperty(String name, float value) throws JMSException
- Specified by:
setFloatProperty
in interfaceMessage
- Throws:
JMSException
-
setDoubleProperty
public void setDoubleProperty(String name, double value) throws JMSException
- Specified by:
setDoubleProperty
in interfaceMessage
- Throws:
JMSException
-
setStringProperty
public void setStringProperty(String name, String value) throws JMSException
- Specified by:
setStringProperty
in interfaceMessage
- Throws:
JMSException
-
checkReadOnlyProperties
protected void checkReadOnlyProperties() throws MessageNotWriteableException
- Throws:
MessageNotWriteableException
-
checkReadOnlyBody
protected void checkReadOnlyBody() throws MessageNotWriteableException
- Throws:
MessageNotWriteableException
-
getAcknowledgeCallback
public Callback getAcknowledgeCallback()
-
setAcknowledgeCallback
public void setAcknowledgeCallback(Callback acknowledgeCallback)
-
onSend
public void onSend() throws JMSException
Send operation event listener. Used to get the message ready to be sent.- Throws:
JMSException
-
visit
public Response visit(CommandVisitor visitor) throws Exception
-
storeContent
public void storeContent()
- Specified by:
storeContent
in classMessage
-
storeContentAndClear
public void storeContentAndClear()
- Specified by:
storeContentAndClear
in classMessage
-
isContentMarshalled
protected boolean isContentMarshalled()
- Overrides:
isContentMarshalled
in classMessage
-
-