org.apache.activemq.command
Class ActiveMQMessage

java.lang.Object
  extended by org.apache.activemq.command.BaseCommand
      extended by org.apache.activemq.command.Message
          extended by org.apache.activemq.command.ActiveMQMessage
All Implemented Interfaces:
javax.jms.Message, MessageReference, Command, DataStructure, MarshallAware, ScheduledMessage
Direct Known Subclasses:
ActiveMQBlobMessage, ActiveMQBytesMessage, ActiveMQMapMessage, ActiveMQObjectMessage, ActiveMQStreamMessage, ActiveMQTextMessage

public class ActiveMQMessage
extends Message
implements Message, ScheduledMessage


Field Summary
protected  Callback acknowledgeCallback
           
static byte DATA_STRUCTURE_TYPE
           
static java.lang.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, marshalledProperties, messageId, 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
ActiveMQMessage()
           
 
Method Summary
 void acknowledge()
           
protected  void checkReadOnlyBody()
           
protected  void checkValidObject(java.lang.Object value)
           
protected  void checkValidScheduled(java.lang.String name, java.lang.Object value)
           
 void clearBody()
           
 void clearProperties()
           
protected  java.lang.Object convertScheduled(java.lang.String name, java.lang.Object value)
           
 Message copy()
           
protected  void copy(ActiveMQMessage copy)
           
protected static java.lang.String decodeString(byte[] data)
           
protected static byte[] encodeString(java.lang.String data)
           
 boolean equals(java.lang.Object o)
           
 Callback getAcknowledgeCallback()
           
 java.util.Enumeration getAllPropertyNames()
          return all property names, including standard JMS properties and JMSX properties
 boolean getBooleanProperty(java.lang.String name)
           
 byte getByteProperty(java.lang.String name)
           
 byte getDataStructureType()
           
 double getDoubleProperty(java.lang.String name)
           
 float getFloatProperty(java.lang.String name)
           
 int getIntProperty(java.lang.String name)
           
 java.lang.String getJMSCorrelationID()
           
 byte[] getJMSCorrelationIDAsBytes()
           
 int getJMSDeliveryMode()
           
 javax.jms.Destination getJMSDestination()
           
 long getJMSExpiration()
           
 java.lang.String getJMSMessageID()
           
 int getJMSPriority()
           
 boolean getJMSRedelivered()
           
 javax.jms.Destination getJMSReplyTo()
           
 long getJMSTimestamp()
           
 java.lang.String getJMSType()
           
 java.lang.String getJMSXMimeType()
          Returns the MIME type of this mesage.
 long getLongProperty(java.lang.String name)
           
 java.lang.Object getObjectProperty(java.lang.String name)
           
 java.util.Enumeration getPropertyNames()
           
 short getShortProperty(java.lang.String name)
           
 java.lang.String getStringProperty(java.lang.String name)
           
 int hashCode()
           
 void onSend()
          Send operation event listener.
 boolean propertyExists(java.lang.String name)
           
 void setAcknowledgeCallback(Callback acknowledgeCallback)
           
 void setBooleanProperty(java.lang.String name, boolean value)
           
 void setBooleanProperty(java.lang.String name, boolean value, boolean checkReadOnly)
           
 void setByteProperty(java.lang.String name, byte value)
           
 void setDoubleProperty(java.lang.String name, double value)
           
 void setFloatProperty(java.lang.String name, float value)
           
 void setIntProperty(java.lang.String name, int value)
           
 void setJMSCorrelationID(java.lang.String correlationId)
           
 void setJMSCorrelationIDAsBytes(byte[] correlationId)
           
 void setJMSDeliveryMode(int mode)
           
 void setJMSDestination(javax.jms.Destination destination)
           
 void setJMSExpiration(long expiration)
           
 void setJMSMessageID(ProducerId producerId, long producerSequenceId)
          This will create an object of MessageId.
 void setJMSMessageID(java.lang.String value)
          Seems to be invalid because the parameter doesn't initialize MessageId instance variables ProducerId and ProducerSequenceId
 void setJMSPriority(int priority)
           
 void setJMSRedelivered(boolean redelivered)
           
 void setJMSReplyTo(javax.jms.Destination destination)
           
 void setJMSTimestamp(long timestamp)
           
 void setJMSType(java.lang.String type)
           
 void setLongProperty(java.lang.String name, long value)
           
 void setObjectProperty(java.lang.String name, java.lang.Object value)
           
 void setObjectProperty(java.lang.String name, java.lang.Object value, boolean checkReadOnly)
           
 void setProperties(java.util.Map properties)
           
 void setShortProperty(java.lang.String name, short value)
           
 void setStringProperty(java.lang.String name, java.lang.String value)
           
 Response visit(CommandVisitor visitor)
           
 
Methods inherited from class org.apache.activemq.command.Message
afterMarshall, afterUnmarshall, beforeMarshall, beforeUnmarshall, clearMarshalledState, copy, decrementReferenceCount, 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, isMarshallAware, isMessage, isPersistent, isReadOnlyBody, isReadOnlyProperties, isRecievedByDFBridge, isRedelivered, lazyCreateProperties, onMessageRolledBack, removeProperty, setArrival, setBrokerInTime, setBrokerOutTime, setBrokerPath, setCluster, setCompressed, setConnection, setContent, setCorrelationId, setDataStructure, setDestination, setDroppable, setExpiration, setGroupID, setGroupSequence, 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, 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
 

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 java.lang.String DLQ_DELIVERY_FAILURE_CAUSE_PROPERTY
See Also:
Constant Field Values

acknowledgeCallback

protected transient Callback acknowledgeCallback
Constructor Detail

ActiveMQMessage

public ActiveMQMessage()
Method Detail

getDataStructureType

public byte getDataStructureType()
Specified by:
getDataStructureType in interface DataStructure
Returns:
The type of the data structure

copy

public Message copy()
Specified by:
copy in class Message

copy

protected void copy(ActiveMQMessage copy)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

acknowledge

public void acknowledge()
                 throws javax.jms.JMSException
Specified by:
acknowledge in interface javax.jms.Message
Throws:
javax.jms.JMSException

clearBody

public void clearBody()
               throws javax.jms.JMSException
Specified by:
clearBody in interface javax.jms.Message
Specified by:
clearBody in class Message
Throws:
javax.jms.JMSException

getJMSMessageID

public java.lang.String getJMSMessageID()
Specified by:
getJMSMessageID in interface javax.jms.Message

setJMSMessageID

public void setJMSMessageID(java.lang.String value)
                     throws javax.jms.JMSException
Seems to be invalid because the parameter doesn't initialize MessageId instance variables ProducerId and ProducerSequenceId

Specified by:
setJMSMessageID in interface javax.jms.Message
Parameters:
value -
Throws:
javax.jms.JMSException

setJMSMessageID

public void setJMSMessageID(ProducerId producerId,
                            long producerSequenceId)
                     throws javax.jms.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:
javax.jms.JMSException

getJMSTimestamp

public long getJMSTimestamp()
Specified by:
getJMSTimestamp in interface javax.jms.Message

setJMSTimestamp

public void setJMSTimestamp(long timestamp)
Specified by:
setJMSTimestamp in interface javax.jms.Message

getJMSCorrelationID

public java.lang.String getJMSCorrelationID()
Specified by:
getJMSCorrelationID in interface javax.jms.Message

setJMSCorrelationID

public void setJMSCorrelationID(java.lang.String correlationId)
Specified by:
setJMSCorrelationID in interface javax.jms.Message

getJMSCorrelationIDAsBytes

public byte[] getJMSCorrelationIDAsBytes()
                                  throws javax.jms.JMSException
Specified by:
getJMSCorrelationIDAsBytes in interface javax.jms.Message
Throws:
javax.jms.JMSException

setJMSCorrelationIDAsBytes

public void setJMSCorrelationIDAsBytes(byte[] correlationId)
                                throws javax.jms.JMSException
Specified by:
setJMSCorrelationIDAsBytes in interface javax.jms.Message
Throws:
javax.jms.JMSException

getJMSXMimeType

public java.lang.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 of BlobMessage it allows you to create a selector on the MIME type of the BLOB body


decodeString

protected static java.lang.String decodeString(byte[] data)
                                        throws javax.jms.JMSException
Throws:
javax.jms.JMSException

encodeString

protected static byte[] encodeString(java.lang.String data)
                              throws javax.jms.JMSException
Throws:
javax.jms.JMSException

getJMSReplyTo

public javax.jms.Destination getJMSReplyTo()
Specified by:
getJMSReplyTo in interface javax.jms.Message

setJMSReplyTo

public void setJMSReplyTo(javax.jms.Destination destination)
                   throws javax.jms.JMSException
Specified by:
setJMSReplyTo in interface javax.jms.Message
Throws:
javax.jms.JMSException

getJMSDestination

public javax.jms.Destination getJMSDestination()
Specified by:
getJMSDestination in interface javax.jms.Message

setJMSDestination

public void setJMSDestination(javax.jms.Destination destination)
                       throws javax.jms.JMSException
Specified by:
setJMSDestination in interface javax.jms.Message
Throws:
javax.jms.JMSException

getJMSDeliveryMode

public int getJMSDeliveryMode()
Specified by:
getJMSDeliveryMode in interface javax.jms.Message

setJMSDeliveryMode

public void setJMSDeliveryMode(int mode)
Specified by:
setJMSDeliveryMode in interface javax.jms.Message

getJMSRedelivered

public boolean getJMSRedelivered()
Specified by:
getJMSRedelivered in interface javax.jms.Message

setJMSRedelivered

public void setJMSRedelivered(boolean redelivered)
Specified by:
setJMSRedelivered in interface javax.jms.Message

getJMSType

public java.lang.String getJMSType()
Specified by:
getJMSType in interface javax.jms.Message

setJMSType

public void setJMSType(java.lang.String type)
Specified by:
setJMSType in interface javax.jms.Message

getJMSExpiration

public long getJMSExpiration()
Specified by:
getJMSExpiration in interface javax.jms.Message

setJMSExpiration

public void setJMSExpiration(long expiration)
Specified by:
setJMSExpiration in interface javax.jms.Message

getJMSPriority

public int getJMSPriority()
Specified by:
getJMSPriority in interface javax.jms.Message

setJMSPriority

public void setJMSPriority(int priority)
Specified by:
setJMSPriority in interface javax.jms.Message

clearProperties

public void clearProperties()
Specified by:
clearProperties in interface javax.jms.Message
Overrides:
clearProperties in class Message

propertyExists

public boolean propertyExists(java.lang.String name)
                       throws javax.jms.JMSException
Specified by:
propertyExists in interface javax.jms.Message
Throws:
javax.jms.JMSException

getPropertyNames

public java.util.Enumeration getPropertyNames()
                                       throws javax.jms.JMSException
Specified by:
getPropertyNames in interface javax.jms.Message
Throws:
javax.jms.JMSException

getAllPropertyNames

public java.util.Enumeration getAllPropertyNames()
                                          throws javax.jms.JMSException
return all property names, including standard JMS properties and JMSX properties

Returns:
Enumeration of all property names on this message
Throws:
javax.jms.JMSException

setObjectProperty

public void setObjectProperty(java.lang.String name,
                              java.lang.Object value)
                       throws javax.jms.JMSException
Specified by:
setObjectProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException

setObjectProperty

public void setObjectProperty(java.lang.String name,
                              java.lang.Object value,
                              boolean checkReadOnly)
                       throws javax.jms.JMSException
Throws:
javax.jms.JMSException

setProperties

public void setProperties(java.util.Map properties)
                   throws javax.jms.JMSException
Throws:
javax.jms.JMSException

checkValidObject

protected void checkValidObject(java.lang.Object value)
                         throws javax.jms.MessageFormatException
Throws:
javax.jms.MessageFormatException

checkValidScheduled

protected void checkValidScheduled(java.lang.String name,
                                   java.lang.Object value)
                            throws javax.jms.MessageFormatException
Throws:
javax.jms.MessageFormatException

convertScheduled

protected java.lang.Object convertScheduled(java.lang.String name,
                                            java.lang.Object value)
                                     throws javax.jms.MessageFormatException
Throws:
javax.jms.MessageFormatException

getObjectProperty

public java.lang.Object getObjectProperty(java.lang.String name)
                                   throws javax.jms.JMSException
Specified by:
getObjectProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException

getBooleanProperty

public boolean getBooleanProperty(java.lang.String name)
                           throws javax.jms.JMSException
Specified by:
getBooleanProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException

getByteProperty

public byte getByteProperty(java.lang.String name)
                     throws javax.jms.JMSException
Specified by:
getByteProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException

getShortProperty

public short getShortProperty(java.lang.String name)
                       throws javax.jms.JMSException
Specified by:
getShortProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException

getIntProperty

public int getIntProperty(java.lang.String name)
                   throws javax.jms.JMSException
Specified by:
getIntProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException

getLongProperty

public long getLongProperty(java.lang.String name)
                     throws javax.jms.JMSException
Specified by:
getLongProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException

getFloatProperty

public float getFloatProperty(java.lang.String name)
                       throws javax.jms.JMSException
Specified by:
getFloatProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException

getDoubleProperty

public double getDoubleProperty(java.lang.String name)
                         throws javax.jms.JMSException
Specified by:
getDoubleProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException

getStringProperty

public java.lang.String getStringProperty(java.lang.String name)
                                   throws javax.jms.JMSException
Specified by:
getStringProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException

setBooleanProperty

public void setBooleanProperty(java.lang.String name,
                               boolean value)
                        throws javax.jms.JMSException
Specified by:
setBooleanProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException

setBooleanProperty

public void setBooleanProperty(java.lang.String name,
                               boolean value,
                               boolean checkReadOnly)
                        throws javax.jms.JMSException
Throws:
javax.jms.JMSException

setByteProperty

public void setByteProperty(java.lang.String name,
                            byte value)
                     throws javax.jms.JMSException
Specified by:
setByteProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException

setShortProperty

public void setShortProperty(java.lang.String name,
                             short value)
                      throws javax.jms.JMSException
Specified by:
setShortProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException

setIntProperty

public void setIntProperty(java.lang.String name,
                           int value)
                    throws javax.jms.JMSException
Specified by:
setIntProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException

setLongProperty

public void setLongProperty(java.lang.String name,
                            long value)
                     throws javax.jms.JMSException
Specified by:
setLongProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException

setFloatProperty

public void setFloatProperty(java.lang.String name,
                             float value)
                      throws javax.jms.JMSException
Specified by:
setFloatProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException

setDoubleProperty

public void setDoubleProperty(java.lang.String name,
                              double value)
                       throws javax.jms.JMSException
Specified by:
setDoubleProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException

setStringProperty

public void setStringProperty(java.lang.String name,
                              java.lang.String value)
                       throws javax.jms.JMSException
Specified by:
setStringProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException

checkReadOnlyBody

protected void checkReadOnlyBody()
                          throws javax.jms.MessageNotWriteableException
Throws:
javax.jms.MessageNotWriteableException

getAcknowledgeCallback

public Callback getAcknowledgeCallback()

setAcknowledgeCallback

public void setAcknowledgeCallback(Callback acknowledgeCallback)

onSend

public void onSend()
            throws javax.jms.JMSException
Send operation event listener. Used to get the message ready to be sent.

Throws:
javax.jms.JMSException

visit

public Response visit(CommandVisitor visitor)
               throws java.lang.Exception
Specified by:
visit in interface Command
Throws:
java.lang.Exception


Copyright © 2005-2011 FuseSource, Corp.. All Rights Reserved.