org.apache.activemq.command
Class Message
java.lang.Object
org.apache.activemq.command.BaseCommand
org.apache.activemq.command.Message
- All Implemented Interfaces:
- MessageReference, Command, DataStructure, MarshallAware
- Direct Known Subclasses:
- ActiveMQMessage
public abstract class Message
- extends BaseCommand
- implements MarshallAware, MessageReference
Represents an ActiveMQ message
- Version:
- $Revision$
Methods inherited from class org.apache.activemq.command.BaseCommand |
copy, getCommandId, getFrom, getTo, isBrokerInfo, isMessage, isMessageAck, isMessageDispatch, isMessageDispatchNotification, isResponse, isResponseRequired, isShutdownInfo, isWireFormatInfo, setCommandId, setFrom, setResponseRequired, setTo, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.activemq.command.Command |
visit |
AVERAGE_MESSAGE_SIZE_OVERHEAD
public static final int AVERAGE_MESSAGE_SIZE_OVERHEAD
- See Also:
- Constant Field Values
messageId
protected MessageId messageId
originalDestination
protected ActiveMQDestination originalDestination
originalTransactionId
protected TransactionId originalTransactionId
producerId
protected ProducerId producerId
destination
protected ActiveMQDestination destination
transactionId
protected TransactionId transactionId
expiration
protected long expiration
timestamp
protected long timestamp
arrival
protected long arrival
correlationId
protected java.lang.String correlationId
replyTo
protected ActiveMQDestination replyTo
persistent
protected boolean persistent
type
protected java.lang.String type
priority
protected byte priority
groupID
protected java.lang.String groupID
groupSequence
protected int groupSequence
targetConsumerId
protected ConsumerId targetConsumerId
compressed
protected boolean compressed
userID
protected java.lang.String userID
content
protected ByteSequence content
marshalledProperties
protected ByteSequence marshalledProperties
dataStructure
protected DataStructure dataStructure
redeliveryCounter
protected int redeliveryCounter
size
protected int size
properties
protected java.util.Map properties
readOnlyProperties
protected boolean readOnlyProperties
readOnlyBody
protected boolean readOnlyBody
recievedByDFBridge
protected transient boolean recievedByDFBridge
droppable
protected boolean droppable
Message
public Message()
copy
public abstract Message copy()
copy
protected void copy(Message copy)
getProperty
public java.lang.Object getProperty(java.lang.String name)
throws java.io.IOException
- Throws:
java.io.IOException
getProperties
public java.util.Map getProperties()
throws java.io.IOException
- Throws:
java.io.IOException
clearProperties
public void clearProperties()
setProperty
public void setProperty(java.lang.String name,
java.lang.Object value)
throws java.io.IOException
- Throws:
java.io.IOException
lazyCreateProperties
protected void lazyCreateProperties()
throws java.io.IOException
- Throws:
java.io.IOException
beforeMarshall
public void beforeMarshall(WireFormat wireFormat)
throws java.io.IOException
- Specified by:
beforeMarshall
in interface MarshallAware
- Throws:
java.io.IOException
afterMarshall
public void afterMarshall(WireFormat wireFormat)
throws java.io.IOException
- Specified by:
afterMarshall
in interface MarshallAware
- Throws:
java.io.IOException
beforeUnmarshall
public void beforeUnmarshall(WireFormat wireFormat)
throws java.io.IOException
- Specified by:
beforeUnmarshall
in interface MarshallAware
- Throws:
java.io.IOException
afterUnmarshall
public void afterUnmarshall(WireFormat wireFormat)
throws java.io.IOException
- Specified by:
afterUnmarshall
in interface MarshallAware
- Throws:
java.io.IOException
getProducerId
public ProducerId getProducerId()
setProducerId
public void setProducerId(ProducerId producerId)
getDestination
public ActiveMQDestination getDestination()
setDestination
public void setDestination(ActiveMQDestination destination)
getTransactionId
public TransactionId getTransactionId()
setTransactionId
public void setTransactionId(TransactionId transactionId)
isInTransaction
public boolean isInTransaction()
getOriginalDestination
public ActiveMQDestination getOriginalDestination()
setOriginalDestination
public void setOriginalDestination(ActiveMQDestination destination)
getMessageId
public MessageId getMessageId()
- Specified by:
getMessageId
in interface MessageReference
setMessageId
public void setMessageId(MessageId messageId)
getOriginalTransactionId
public TransactionId getOriginalTransactionId()
setOriginalTransactionId
public void setOriginalTransactionId(TransactionId transactionId)
getGroupID
public java.lang.String getGroupID()
- Specified by:
getGroupID
in interface MessageReference
setGroupID
public void setGroupID(java.lang.String groupID)
getGroupSequence
public int getGroupSequence()
- Specified by:
getGroupSequence
in interface MessageReference
setGroupSequence
public void setGroupSequence(int groupSequence)
getCorrelationId
public java.lang.String getCorrelationId()
setCorrelationId
public void setCorrelationId(java.lang.String correlationId)
isPersistent
public boolean isPersistent()
- Specified by:
isPersistent
in interface MessageReference
setPersistent
public void setPersistent(boolean deliveryMode)
getExpiration
public long getExpiration()
- Specified by:
getExpiration
in interface MessageReference
setExpiration
public void setExpiration(long expiration)
getPriority
public byte getPriority()
setPriority
public void setPriority(byte priority)
getReplyTo
public ActiveMQDestination getReplyTo()
setReplyTo
public void setReplyTo(ActiveMQDestination replyTo)
getTimestamp
public long getTimestamp()
setTimestamp
public void setTimestamp(long timestamp)
getType
public java.lang.String getType()
setType
public void setType(java.lang.String type)
getContent
public ByteSequence getContent()
setContent
public void setContent(ByteSequence content)
getMarshalledProperties
public ByteSequence getMarshalledProperties()
setMarshalledProperties
public void setMarshalledProperties(ByteSequence marshalledProperties)
getDataStructure
public DataStructure getDataStructure()
setDataStructure
public void setDataStructure(DataStructure data)
getTargetConsumerId
public ConsumerId getTargetConsumerId()
- Can be used to route the message to a specific consumer. Should
be null to allow the broker use normal JMS routing semantics. If
the target consumer id is an active consumer on the broker, the message
is dropped. Used by the AdvisoryBroker to replay advisory messages
to a specific consumer.
- Specified by:
getTargetConsumerId
in interface MessageReference
setTargetConsumerId
public void setTargetConsumerId(ConsumerId targetConsumerId)
isExpired
public boolean isExpired()
- Description copied from interface:
MessageReference
- Returns true if this message is expired
- Specified by:
isExpired
in interface MessageReference
isAdvisory
public boolean isAdvisory()
isCompressed
public boolean isCompressed()
setCompressed
public void setCompressed(boolean compressed)
isRedelivered
public boolean isRedelivered()
setRedelivered
public void setRedelivered(boolean redelivered)
incrementRedeliveryCounter
public void incrementRedeliveryCounter()
- Specified by:
incrementRedeliveryCounter
in interface MessageReference
getRedeliveryCounter
public int getRedeliveryCounter()
- Specified by:
getRedeliveryCounter
in interface MessageReference
setRedeliveryCounter
public void setRedeliveryCounter(int deliveryCounter)
getBrokerPath
public BrokerId[] getBrokerPath()
- The route of brokers the command has moved through.
setBrokerPath
public void setBrokerPath(BrokerId[] brokerPath)
isReadOnlyProperties
public boolean isReadOnlyProperties()
setReadOnlyProperties
public void setReadOnlyProperties(boolean readOnlyProperties)
isReadOnlyBody
public boolean isReadOnlyBody()
setReadOnlyBody
public void setReadOnlyBody(boolean readOnlyBody)
getConnection
public ActiveMQConnection getConnection()
setConnection
public void setConnection(ActiveMQConnection connection)
getArrival
public long getArrival()
- Used to schedule the arrival time of a message to a broker. The broker will
not dispatch a message to a consumer until it's arrival time has elapsed.
setArrival
public void setArrival(long arrival)
getUserID
public java.lang.String getUserID()
- Only set by the broker and defines the userID of the producer connection who
sent this message. This is an optional field, it needs to be enabled on the
broker to have this field populated.
setUserID
public void setUserID(java.lang.String jmsxUserID)
getReferenceCount
public int getReferenceCount()
- Specified by:
getReferenceCount
in interface MessageReference
getMessageHardRef
public Message getMessageHardRef()
- Specified by:
getMessageHardRef
in interface MessageReference
getMessage
public Message getMessage()
throws java.io.IOException
- Specified by:
getMessage
in interface MessageReference
- Throws:
java.io.IOException
getRegionDestination
public Destination getRegionDestination()
- Specified by:
getRegionDestination
in interface MessageReference
setRegionDestination
public void setRegionDestination(Destination destination)
isMarshallAware
public boolean isMarshallAware()
- Specified by:
isMarshallAware
in interface DataStructure
- Overrides:
isMarshallAware
in class BaseCommand
getCachedMarshalledForm
public ByteSequence getCachedMarshalledForm(WireFormat wireFormat)
- Specified by:
getCachedMarshalledForm
in interface MarshallAware
evictMarshlledForm
public void evictMarshlledForm()
setCachedMarshalledForm
public void setCachedMarshalledForm(WireFormat wireFormat,
ByteSequence data)
- Specified by:
setCachedMarshalledForm
in interface MarshallAware
incrementReferenceCount
public int incrementReferenceCount()
- Specified by:
incrementReferenceCount
in interface MessageReference
decrementReferenceCount
public int decrementReferenceCount()
- Specified by:
decrementReferenceCount
in interface MessageReference
getSize
public int getSize()
- Specified by:
getSize
in interface MessageReference
isRecievedByDFBridge
public boolean isRecievedByDFBridge()
- Returns:
- Returns the recievedByDFBridge.
setRecievedByDFBridge
public void setRecievedByDFBridge(boolean recievedByDFBridge)
- Parameters:
recievedByDFBridge
- The recievedByDFBridge to set.
onMessageRolledBack
public void onMessageRolledBack()
isDroppable
public boolean isDroppable()
setDroppable
public void setDroppable(boolean droppable)
Copyright © 2009 Apache Software Foundation. All Rights Reserved.