public abstract class AbstractMessage extends Object implements javax.jms.Message
Base implementation for a JMS message
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
bodyIsReadOnly |
| Constructor and Description |
|---|
AbstractMessage()
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
acknowledge() |
protected void |
assertDeserializationLevel(int targetLevel) |
void |
clearProperties() |
abstract AbstractMessage |
copy()
Create an independant copy of this message
|
protected void |
copyCommonFields(AbstractMessage clone)
Create an independant copy of this message
|
void |
ensureDeserializationLevel(int targetLevel) |
boolean |
getBooleanProperty(String name) |
byte |
getByteProperty(String name) |
double |
getDoubleProperty(String name) |
float |
getFloatProperty(String name) |
int |
getIntProperty(String name) |
String |
getJMSCorrelationID() |
byte[] |
getJMSCorrelationIDAsBytes() |
int |
getJMSDeliveryMode() |
javax.jms.Destination |
getJMSDestination() |
long |
getJMSExpiration() |
String |
getJMSMessageID() |
int |
getJMSPriority() |
boolean |
getJMSRedelivered() |
javax.jms.Destination |
getJMSReplyTo() |
long |
getJMSTimestamp() |
String |
getJMSType() |
long |
getLongProperty(String name) |
Object |
getObjectProperty(String name) |
Enumeration<String> |
getPropertyNames() |
RawDataBuffer |
getRawMessage()
Get the raw message form if available
|
protected AbstractSession |
getSession()
Get the parent session
|
short |
getShortProperty(String name) |
String |
getStringProperty(String name) |
protected abstract byte |
getType()
Get the type value for this message
|
protected void |
initializeFromRaw(RawDataBuffer rawMessage)
Initialize the message from the given raw data
|
boolean |
isInternalCopy()
Test if this message is an internal copy
|
void |
markAsReadOnly() |
boolean |
propertyExists(String name) |
protected Map<String,Object> |
readMapFrom(RawDataBuffer in)
Write a map to the given output stream
|
protected abstract void |
serializeBodyTo(RawDataBuffer out) |
protected void |
serializeTo(RawDataBuffer out)
Write the message content to the given output stream
|
void |
setBooleanProperty(String name,
boolean value) |
void |
setByteProperty(String name,
byte value) |
void |
setDoubleProperty(String name,
double value) |
void |
setFloatProperty(String name,
float value) |
void |
setInternalCopy(boolean copy)
Set if this message is an internal copy
|
void |
setIntProperty(String name,
int value) |
void |
setJMSCorrelationID(String correlationID) |
void |
setJMSCorrelationIDAsBytes(byte[] correlationID) |
void |
setJMSDeliveryMode(int deliveryMode) |
void |
setJMSDestination(javax.jms.Destination destination) |
void |
setJMSExpiration(long expiration) |
void |
setJMSMessageID(String id) |
void |
setJMSPriority(int priority) |
void |
setJMSRedelivered(boolean redelivered) |
void |
setJMSReplyTo(javax.jms.Destination replyTo) |
void |
setJMSTimestamp(long timestamp) |
void |
setJMSType(String type) |
void |
setLongProperty(String name,
long value) |
void |
setObjectProperty(String name,
Object value) |
void |
setSession(AbstractSession session)
Set the message session
|
void |
setShortProperty(String name,
short value) |
void |
setStringProperty(String name,
String value) |
String |
toString() |
protected abstract void |
unserializeBodyFrom(RawDataBuffer in) |
protected void |
writeMapTo(Map<String,Object> map,
RawDataBuffer out)
Write a map to the given output stream
|
public final RawDataBuffer getRawMessage()
public abstract AbstractMessage copy()
protected final void copyCommonFields(AbstractMessage clone)
public final void setSession(AbstractSession session) throws javax.jms.JMSException
javax.jms.JMSExceptionprotected final AbstractSession getSession() throws javax.jms.JMSException
javax.jms.JMSExceptionpublic final void acknowledge()
throws javax.jms.JMSException
acknowledge in interface javax.jms.Messagejavax.jms.JMSExceptionpublic final void clearProperties()
clearProperties in interface javax.jms.Messagepublic final boolean getBooleanProperty(String name) throws javax.jms.JMSException
getBooleanProperty in interface javax.jms.Messagejavax.jms.JMSExceptionpublic final byte getByteProperty(String name) throws javax.jms.JMSException
getByteProperty in interface javax.jms.Messagejavax.jms.JMSExceptionpublic final double getDoubleProperty(String name) throws javax.jms.JMSException
getDoubleProperty in interface javax.jms.Messagejavax.jms.JMSExceptionpublic final float getFloatProperty(String name) throws javax.jms.JMSException
getFloatProperty in interface javax.jms.Messagejavax.jms.JMSExceptionpublic final int getIntProperty(String name) throws javax.jms.JMSException
getIntProperty in interface javax.jms.Messagejavax.jms.JMSExceptionpublic final String getJMSCorrelationID()
getJMSCorrelationID in interface javax.jms.Messagepublic final byte[] getJMSCorrelationIDAsBytes()
getJMSCorrelationIDAsBytes in interface javax.jms.Messagepublic final int getJMSDeliveryMode()
getJMSDeliveryMode in interface javax.jms.Messagepublic final javax.jms.Destination getJMSDestination()
getJMSDestination in interface javax.jms.Messagepublic final long getJMSExpiration()
getJMSExpiration in interface javax.jms.Messagepublic final String getJMSMessageID()
getJMSMessageID in interface javax.jms.Messagepublic final int getJMSPriority()
getJMSPriority in interface javax.jms.Messagepublic final boolean getJMSRedelivered()
getJMSRedelivered in interface javax.jms.Messagepublic final javax.jms.Destination getJMSReplyTo()
getJMSReplyTo in interface javax.jms.Messagepublic final long getJMSTimestamp()
getJMSTimestamp in interface javax.jms.Messagepublic final String getJMSType()
getJMSType in interface javax.jms.Messagepublic final long getLongProperty(String name) throws javax.jms.JMSException
getLongProperty in interface javax.jms.Messagejavax.jms.JMSExceptionpublic final Object getObjectProperty(String name)
getObjectProperty in interface javax.jms.Messagepublic final short getShortProperty(String name) throws javax.jms.JMSException
getShortProperty in interface javax.jms.Messagejavax.jms.JMSExceptionpublic final String getStringProperty(String name) throws javax.jms.JMSException
getStringProperty in interface javax.jms.Messagejavax.jms.JMSExceptionpublic final boolean propertyExists(String name)
propertyExists in interface javax.jms.Messagepublic final void setBooleanProperty(String name, boolean value) throws javax.jms.JMSException
setBooleanProperty in interface javax.jms.Messagejavax.jms.JMSExceptionpublic final void setByteProperty(String name, byte value) throws javax.jms.JMSException
setByteProperty in interface javax.jms.Messagejavax.jms.JMSExceptionpublic final void setDoubleProperty(String name, double value) throws javax.jms.JMSException
setDoubleProperty in interface javax.jms.Messagejavax.jms.JMSExceptionpublic final void setFloatProperty(String name, float value) throws javax.jms.JMSException
setFloatProperty in interface javax.jms.Messagejavax.jms.JMSExceptionpublic final void setIntProperty(String name, int value) throws javax.jms.JMSException
setIntProperty in interface javax.jms.Messagejavax.jms.JMSExceptionpublic final void setJMSCorrelationID(String correlationID)
setJMSCorrelationID in interface javax.jms.Messagepublic final void setJMSCorrelationIDAsBytes(byte[] correlationID)
setJMSCorrelationIDAsBytes in interface javax.jms.Messagepublic final void setJMSDeliveryMode(int deliveryMode)
throws javax.jms.JMSException
setJMSDeliveryMode in interface javax.jms.Messagejavax.jms.JMSExceptionpublic final void setJMSDestination(javax.jms.Destination destination)
throws javax.jms.JMSException
setJMSDestination in interface javax.jms.Messagejavax.jms.JMSExceptionpublic final void setJMSExpiration(long expiration)
setJMSExpiration in interface javax.jms.Messagepublic final void setJMSMessageID(String id) throws javax.jms.JMSException
setJMSMessageID in interface javax.jms.Messagejavax.jms.JMSExceptionpublic final void setJMSPriority(int priority)
throws javax.jms.JMSException
setJMSPriority in interface javax.jms.Messagejavax.jms.JMSExceptionpublic final void setJMSRedelivered(boolean redelivered)
setJMSRedelivered in interface javax.jms.Messagepublic final void setJMSReplyTo(javax.jms.Destination replyTo)
setJMSReplyTo in interface javax.jms.Messagepublic final void setJMSTimestamp(long timestamp)
setJMSTimestamp in interface javax.jms.Messagepublic final void setJMSType(String type)
setJMSType in interface javax.jms.Messagepublic final void setLongProperty(String name, long value) throws javax.jms.JMSException
setLongProperty in interface javax.jms.Messagejavax.jms.JMSExceptionpublic final void setObjectProperty(String name, Object value) throws javax.jms.JMSException
setObjectProperty in interface javax.jms.Messagejavax.jms.JMSExceptionpublic final void setShortProperty(String name, short value) throws javax.jms.JMSException
setShortProperty in interface javax.jms.Messagejavax.jms.JMSExceptionpublic final void setStringProperty(String name, String value) throws javax.jms.JMSException
setStringProperty in interface javax.jms.Messagejavax.jms.JMSExceptionpublic final Enumeration<String> getPropertyNames()
getPropertyNames in interface javax.jms.Messagepublic final boolean isInternalCopy()
public final void setInternalCopy(boolean copy)
protected abstract byte getType()
protected final void serializeTo(RawDataBuffer out)
protected final void initializeFromRaw(RawDataBuffer rawMessage)
public final void ensureDeserializationLevel(int targetLevel)
protected final void assertDeserializationLevel(int targetLevel)
public final void markAsReadOnly()
protected abstract void serializeBodyTo(RawDataBuffer out)
protected abstract void unserializeBodyFrom(RawDataBuffer in)
protected final void writeMapTo(Map<String,Object> map, RawDataBuffer out)
protected final Map<String,Object> readMapFrom(RawDataBuffer in)
Copyright © 2021. All rights reserved.