Class MessageImpl
- java.lang.Object
-
- com.swiftmq.jms.MessageImpl
-
- All Implemented Interfaces:
jakarta.jms.Message,java.io.Serializable
- Direct Known Subclasses:
BytesMessageImpl,MapMessageImpl,ObjectMessageImpl,StreamMessageImpl,TextMessageImpl
public class MessageImpl extends java.lang.Object implements jakarta.jms.Message, java.io.SerializableImplementation of a Message.- Author:
- IIT GmbH, Bremen/Germany, Copyright (c) 2000-2005, All Rights Reserved
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_PRIORITYstatic intMAX_PRIORITYstatic intMIN_PRIORITYstatic java.lang.StringPROP_CLIENT_IDstatic java.lang.StringPROP_DELIVERY_COUNTstatic java.lang.StringPROP_DOUBT_DUPLICATEstatic java.lang.StringPROP_UNROUTABLE_REASONstatic java.lang.StringPROP_USER_ID
-
Constructor Summary
Constructors Constructor Description MessageImpl()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidacknowledge()Acknowledge this and all previous messages received.voidclearBody()Clear out the message body.voidclearProperties()Clear a message's properties.voidclearSwiftMQAllProps()voidclearSwiftMQProps()static MessageImplcreateInstance(int type)<T> TgetBody(java.lang.Class<T> aClass)booleangetBooleanProperty(java.lang.String name)Return the boolean property value with the given name.bytegetByteProperty(java.lang.String name)Return the byte property value with the given name.java.lang.StringgetDestQueue()java.lang.StringgetDestRouter()doublegetDoubleProperty(java.lang.String name)Return the double property value with the given name.java.lang.StringgetDuplicateId()java.lang.ObjectgetField(java.lang.String name)floatgetFloatProperty(java.lang.String name)Return the float property value with the given name.intgetIntProperty(java.lang.String name)Return the integer property value with the given name.java.lang.StringgetJMSCorrelationID()Get the correlation ID for the message.byte[]getJMSCorrelationIDAsBytes()Get the correlation ID as an array of bytes for the message.intgetJMSDeliveryMode()Get the delivery mode for this message.longgetJMSDeliveryTime()jakarta.jms.DestinationgetJMSDestination()Get the destination for this message.longgetJMSExpiration()Get the message's expiration value.java.lang.StringgetJMSMessageID()Get the message ID.intgetJMSPriority()Get the message priority.booleangetJMSRedelivered()Get an indication of whether this message is being redelivered.jakarta.jms.DestinationgetJMSReplyTo()Get where a reply to this message should be sent.longgetJMSTimestamp()Get the message timestamp.java.lang.StringgetJMSType()Get the message type.longgetLongProperty(java.lang.String name)Return the long property value with the given name.MessageIndexgetMessageIndex()longgetMessageLength()java.lang.ObjectgetObjectProperty(java.lang.String name)Return the Java object property value with the given name.java.lang.ObjectgetPersistentKey()java.util.EnumerationgetPropertyNames()Return an Enumeration of all the property names.shortgetShortProperty(java.lang.String name)Return the short property value with the given name.java.lang.StringgetSourceRouter()java.lang.ObjectgetStreamPKey()java.lang.StringgetStringProperty(java.lang.String name)Return the String property value with the given name.protected intgetType()booleanisBodyAssignableTo(java.lang.Class aClass)booleanisCancelled()booleanpropertyExists(java.lang.String name)Check if a property value exists.protected voidreadBody(java.io.DataInput in)voidreadContent(LengthCaptureDataInput in)voidreadContent(java.io.DataInput in)voidremoveProperty(java.lang.String name)voidreset()voidsetBooleanProperty(java.lang.String name, boolean value)Set a boolean property value with the given name, into the Message.voidsetByteProperty(java.lang.String name, byte value)Set a byte property value with the given name, into the Message.voidsetDestQueue(java.lang.String destQueue)voidsetDestRouter(java.lang.String destRouter)voidsetDoubleProperty(java.lang.String name, double value)Set a double property value with the given name, into the Message.voidsetDuplicateId(java.lang.String duplicateId)voidsetFloatProperty(java.lang.String name, float value)Set a float property value with the given name, into the Message.voidsetIntProperty(java.lang.String name, int value)Set an integer property value with the given name, into the Message.voidsetJMSCorrelationID(java.lang.String correlationID)Set the correlation ID for the message.voidsetJMSCorrelationIDAsBytes(byte[] correlationID)Set the correlation ID as an array of bytes for the message.voidsetJMSDeliveryMode(int deliveryMode)Set the delivery mode for this message.voidsetJMSDeliveryTime(long l)voidsetJMSDestination(jakarta.jms.Destination destination)Set the destination for this message.voidsetJMSExpiration(long expiration)Set the message's expiration value.voidsetJMSMessageID(java.lang.String id)Set the message ID.voidsetJMSPriority(int priority)Set the priority for this message.voidsetJMSRedelivered(boolean redelivered)Set to indicate whether this message is being redelivered.voidsetJMSReplyTo(jakarta.jms.Destination replyTo)Set where a reply to this message should be sent.voidsetJMSTimestamp(long timestamp)Set the message timestamp.voidsetJMSType(java.lang.String type)Set the message type.voidsetLongProperty(java.lang.String name, long value)Set a long property value with the given name, into the Message.voidsetMessageConsumerImpl(SwiftMQMessageConsumer myConsumer)voidsetMessageIndex(MessageIndex messageIndex)voidsetObjectProperty(java.lang.String name, java.lang.Object value)Set a Java object property value with the given name, into the Message.voidsetPersistentKey(java.lang.Object persistentKey)voidsetReadOnly(boolean b)voidsetSessionImpl(SwiftMQSession mySession)voidsetShortProperty(java.lang.String name, short value)Set a short property value with the given name, into the Message.voidsetSourceRouter(java.lang.String sourceRouter)voidsetStreamPKey(java.lang.Object streamPKey)voidsetStringProperty(java.lang.String name, java.lang.String value)Set a String property value with the given name, into the Message.voidsetUseThreadContextCL(boolean b)java.lang.StringtoString()protected voidunfoldBody()voidunfoldBuffers()protected voidwriteBody(java.io.DataOutput out)voidwriteContent(ToClientSerializer serializer)voidwriteContent(java.io.DataOutput out)
-
-
-
Field Detail
-
PROP_DELIVERY_COUNT
public static final java.lang.String PROP_DELIVERY_COUNT
- See Also:
- Constant Field Values
-
PROP_USER_ID
public static final java.lang.String PROP_USER_ID
- See Also:
- Constant Field Values
-
PROP_CLIENT_ID
public static final java.lang.String PROP_CLIENT_ID
- See Also:
- Constant Field Values
-
PROP_UNROUTABLE_REASON
public static final java.lang.String PROP_UNROUTABLE_REASON
- See Also:
- Constant Field Values
-
PROP_DOUBT_DUPLICATE
public static final java.lang.String PROP_DOUBT_DUPLICATE
- See Also:
- Constant Field Values
-
MAX_PRIORITY
public static final int MAX_PRIORITY
- See Also:
- Constant Field Values
-
MIN_PRIORITY
public static final int MIN_PRIORITY
- See Also:
- Constant Field Values
-
DEFAULT_PRIORITY
public static final int DEFAULT_PRIORITY
- See Also:
- Constant Field Values
-
-
Method Detail
-
createInstance
public static MessageImpl createInstance(int type)
-
getType
protected int getType()
-
getPersistentKey
public java.lang.Object getPersistentKey()
-
setPersistentKey
public void setPersistentKey(java.lang.Object persistentKey)
-
getStreamPKey
public java.lang.Object getStreamPKey()
-
setStreamPKey
public void setStreamPKey(java.lang.Object streamPKey)
-
getMessageLength
public long getMessageLength()
-
isCancelled
public boolean isCancelled()
-
getDuplicateId
public java.lang.String getDuplicateId()
-
setDuplicateId
public void setDuplicateId(java.lang.String duplicateId)
-
writeBody
protected void writeBody(java.io.DataOutput out) throws java.io.IOException- Throws:
java.io.IOException
-
writeContent
public void writeContent(java.io.DataOutput out) throws java.io.IOException- Throws:
java.io.IOException
-
writeContent
public void writeContent(ToClientSerializer serializer) throws java.io.IOException
- Throws:
java.io.IOException
-
readBody
protected void readBody(java.io.DataInput in) throws java.io.IOException- Throws:
java.io.IOException
-
readContent
public void readContent(LengthCaptureDataInput in) throws java.io.IOException
- Throws:
java.io.IOException
-
readContent
public void readContent(java.io.DataInput in) throws java.io.IOException- Throws:
java.io.IOException
-
setUseThreadContextCL
public void setUseThreadContextCL(boolean b)
-
unfoldBuffers
public void unfoldBuffers()
-
unfoldBody
protected void unfoldBody()
-
getField
public java.lang.Object getField(java.lang.String name)
-
clearSwiftMQProps
public void clearSwiftMQProps()
-
clearSwiftMQAllProps
public void clearSwiftMQAllProps()
-
setMessageConsumerImpl
public void setMessageConsumerImpl(SwiftMQMessageConsumer myConsumer)
-
setSessionImpl
public void setSessionImpl(SwiftMQSession mySession)
-
setReadOnly
public void setReadOnly(boolean b)
-
getMessageIndex
public MessageIndex getMessageIndex()
-
setMessageIndex
public void setMessageIndex(MessageIndex messageIndex)
-
getSourceRouter
public java.lang.String getSourceRouter()
-
setSourceRouter
public void setSourceRouter(java.lang.String sourceRouter)
-
getDestRouter
public java.lang.String getDestRouter()
-
setDestRouter
public void setDestRouter(java.lang.String destRouter)
-
getDestQueue
public java.lang.String getDestQueue()
-
setDestQueue
public void setDestQueue(java.lang.String destQueue)
-
removeProperty
public void removeProperty(java.lang.String name)
-
getJMSMessageID
public java.lang.String getJMSMessageID() throws jakarta.jms.JMSExceptionGet the message ID.The messageID header field contains a value that uniquely identifies each message sent by a provider.
When a message is sent, messageID can be ignored. When the send method returns it contains a provider-assigned value.
A JMSMessageID is a String value which should function as a unique key for identifying messages in a historical repository. The exact scope of uniqueness is provider defined. It should at least cover all messages for a specific installation of a provider where an installation is some connected set of message routers.
All JMSMessageID values must start with the prefix `ID:'. Uniqueness of message ID values across different providers is not required.
Since message ID's take some effort to create and increase a message's size, some JMS providers may be able to optimize message overhead if they are given a hint that message ID is not used by an application. JMS message Producers provide a hint to disable message ID. When a client sets a Producer to disable message ID they are saying that they do not depend on the value of message ID for the messages it produces. These messages must either have message ID set to null or, if the hint is ignored, messageID must be set to its normal unique value.
- Specified by:
getJMSMessageIDin interfacejakarta.jms.Message- Returns:
- the message ID
- Throws:
jakarta.jms.JMSException- if JMS fails to get the message Id due to internal JMS error.
-
setJMSMessageID
public void setJMSMessageID(java.lang.String id) throws jakarta.jms.JMSExceptionSet the message ID.Providers set this field when a message is sent. This operation can be used to change the value of a message that's been received.
- Specified by:
setJMSMessageIDin interfacejakarta.jms.Message- Parameters:
id- the ID of the message- Throws:
jakarta.jms.JMSException- if JMS fails to set the message Id due to internal JMS error.- See Also:
Message.getJMSMessageID()
-
getJMSTimestamp
public long getJMSTimestamp() throws jakarta.jms.JMSExceptionGet the message timestamp.The JMSTimestamp header field contains the time a message was handed off to a provider to be sent. It is not the time the message was actually transmitted because the actual send may occur later due to transactions or other client side queueing of messages.
When a message is sent, JMSTimestamp is ignored. When the send method returns it contains a a time value somewhere in the interval between the call and the return. It is in the format of a normal Java millis time value.
Since timestamps take some effort to create and increase a message's size, some JMS providers may be able to optimize message overhead if they are given a hint that timestamp is not used by an application. JMS message Producers provide a hint to disable timestamps. When a client sets a producer to disable timestamps they are saying that they do not depend on the value of timestamp for the messages it produces. These messages must either have timestamp set to null or, if the hint is ignored, timestamp must be set to its normal value.
- Specified by:
getJMSTimestampin interfacejakarta.jms.Message- Returns:
- the message timestamp
- Throws:
jakarta.jms.JMSException- if JMS fails to get the Timestamp due to internal JMS error.
-
setJMSTimestamp
public void setJMSTimestamp(long timestamp) throws jakarta.jms.JMSExceptionSet the message timestamp.Providers set this field when a message is sent. This operation can be used to change the value of a message that's been received.
- Specified by:
setJMSTimestampin interfacejakarta.jms.Message- Parameters:
timestamp- the timestamp for this message- Throws:
jakarta.jms.JMSException- if JMS fails to set the timestamp due to some internal JMS error.- See Also:
Message.getJMSTimestamp()
-
getJMSCorrelationIDAsBytes
public byte[] getJMSCorrelationIDAsBytes() throws jakarta.jms.JMSExceptionGet the correlation ID as an array of bytes for the message.The use of a byte[] value for JMSCorrelationID is non-portable.
- Specified by:
getJMSCorrelationIDAsBytesin interfacejakarta.jms.Message- Returns:
- the correlation ID of a message as an array of bytes.
- Throws:
jakarta.jms.JMSException- if JMS fails to get correlationId due to some internal JMS error.
-
setJMSCorrelationIDAsBytes
public void setJMSCorrelationIDAsBytes(byte[] correlationID) throws jakarta.jms.JMSExceptionSet the correlation ID as an array of bytes for the message.If a provider supports the native concept of correlation id, a JMS client may need to assign specific JMSCorrelationID values to match those expected by non-JMS clients. JMS providers without native correlation id values are not required to support this (and the corresponding get) method; their implementation may throw java.lang.UnsupportedOperationException).
The use of a byte[] value for JMSCorrelationID is non-portable.
- Specified by:
setJMSCorrelationIDAsBytesin interfacejakarta.jms.Message- Parameters:
correlationID- the correlation ID value as an array of bytes.- Throws:
jakarta.jms.JMSException- if JMS fails to set correlationId due to some internal JMS error.
-
getJMSCorrelationID
public java.lang.String getJMSCorrelationID() throws jakarta.jms.JMSExceptionGet the correlation ID for the message.This method is used to return correlation id values that are either provider-specific message ID's or application-specific Strings.
- Specified by:
getJMSCorrelationIDin interfacejakarta.jms.Message- Returns:
- the correlation ID of a message as a String.
- Throws:
jakarta.jms.JMSException- if JMS fails to get correlationId due to some internal JMS error.
-
setJMSCorrelationID
public void setJMSCorrelationID(java.lang.String correlationID) throws jakarta.jms.JMSExceptionSet the correlation ID for the message.A client can use the JMSCorrelationID header field to link one message with another. A typically use is to link a response message with its request message.
JMSCorrelationID can hold one of the following:
- A provider-specific message ID
- An application-specific String
- A provider-native byte[] value.
Since each message sent by a JMS provider is assigned a message ID value it is convenient to link messages via message ID. All message ID values must start with the `ID:' prefix.
In some cases, an application (made up of several clients) needs to use an application specific value for linking messages. For instance, an application may use JMSCorrelationID to hold a value referencing some external information. Application specified values must not start with the `ID:' prefix; this is reserved for provider-generated message ID values.
If a provider supports the native concept of correlation ID, a JMS client may need to assign specific JMSCorrelationID values to match those expected by non-JMS clients. A byte[] value is used for this purpose. JMS providers without native correlation ID values are not required to support byte[] values. The use of a byte[] value for JMSCorrelationID is non-portable.
- Specified by:
setJMSCorrelationIDin interfacejakarta.jms.Message- Parameters:
correlationID- the message ID of a message being referred to.- Throws:
jakarta.jms.JMSException- if JMS fails to set correlationId due to some internal JMS error.
-
getJMSReplyTo
public jakarta.jms.Destination getJMSReplyTo() throws jakarta.jms.JMSExceptionGet where a reply to this message should be sent.- Specified by:
getJMSReplyToin interfacejakarta.jms.Message- Returns:
- where to send a response to this message
- Throws:
jakarta.jms.JMSException- if JMS fails to get ReplyTo Destination due to some internal JMS error.
-
setJMSReplyTo
public void setJMSReplyTo(jakarta.jms.Destination replyTo) throws jakarta.jms.JMSExceptionSet where a reply to this message should be sent.The replyTo header field contains the destination where a reply to the current message should be sent. If it is null no reply is expected. The destination may be either a Queue or a Topic.
Messages with a null replyTo value are called JMS datagrams. Datagrams may be a notification of some change in the sender (i.e. they signal a sender event) or they may just be some data the sender thinks is of interest.
Messages with a replyTo value are typically expecting a response. A response may be optional, it is up to the client to decide. These messages are called JMS requests. A message sent in response to a request is called a reply. In some cases a client may wish to match up a request it sent earlier with a reply it has just received. This can be done using the correlationID.- Specified by:
setJMSReplyToin interfacejakarta.jms.Message- Parameters:
replyTo- where to send a response to this message- Throws:
jakarta.jms.JMSException- if JMS fails to set ReplyTo Destination due to some internal JMS error.- See Also:
Message.getJMSReplyTo()
-
getJMSDestination
public jakarta.jms.Destination getJMSDestination() throws jakarta.jms.JMSExceptionGet the destination for this message.The destination field contains the destination to which the message is being sent.
When a message is sent this value is ignored. After completion of the send method it holds the destination specified by the send.
When a message is received, its destination value must be equivalent to the value assigned when it was sent.
- Specified by:
getJMSDestinationin interfacejakarta.jms.Message- Returns:
- the destination of this message.
- Throws:
jakarta.jms.JMSException- if JMS fails to get JMS Destination due to some internal JMS error.
-
setJMSDestination
public void setJMSDestination(jakarta.jms.Destination destination) throws jakarta.jms.JMSExceptionSet the destination for this message.Providers set this field when a message is sent. This operation can be used to change the value of a message that's been received.
- Specified by:
setJMSDestinationin interfacejakarta.jms.Message- Parameters:
destination- the destination for this message.- Throws:
jakarta.jms.JMSException- if JMS fails to set JMS Destination due to some internal JMS error.- See Also:
Message.getJMSDestination()
-
getJMSDeliveryMode
public int getJMSDeliveryMode() throws jakarta.jms.JMSExceptionGet the delivery mode for this message.- Specified by:
getJMSDeliveryModein interfacejakarta.jms.Message- Returns:
- the delivery mode of this message.
- Throws:
jakarta.jms.JMSException- if JMS fails to get JMS DeliveryMode due to some internal JMS error.- See Also:
DeliveryMode
-
setJMSDeliveryMode
public void setJMSDeliveryMode(int deliveryMode) throws jakarta.jms.JMSExceptionSet the delivery mode for this message.Providers set this field when a message is sent. This operation can be used to change the value of a message that's been received.
- Specified by:
setJMSDeliveryModein interfacejakarta.jms.Message- Parameters:
deliveryMode- the delivery mode for this message.- Throws:
jakarta.jms.JMSException- if JMS fails to set JMS DeliveryMode due to some internal JMS error.- See Also:
Message.getJMSDeliveryMode(),DeliveryMode
-
getJMSRedelivered
public boolean getJMSRedelivered() throws jakarta.jms.JMSExceptionGet an indication of whether this message is being redelivered.If a client receives a message with the redelivered indicator set, it is likely, but not guaranteed, that this message was delivered to the client earlier but the client did not acknowledge its receipt at that earlier time.
- Specified by:
getJMSRedeliveredin interfacejakarta.jms.Message- Returns:
- set to true if this message is being redelivered.
- Throws:
jakarta.jms.JMSException- if JMS fails to get JMS Redelivered flag due to some internal JMS error.
-
setJMSRedelivered
public void setJMSRedelivered(boolean redelivered) throws jakarta.jms.JMSExceptionSet to indicate whether this message is being redelivered.This field is set at the time the message is delivered. This operation can be used to change the value of a message that's been received.
- Specified by:
setJMSRedeliveredin interfacejakarta.jms.Message- Parameters:
redelivered- an indication of whether this message is being redelivered.- Throws:
jakarta.jms.JMSException- if JMS fails to set JMS Redelivered flag due to some internal JMS error.- See Also:
Message.getJMSRedelivered()
-
getJMSType
public java.lang.String getJMSType() throws jakarta.jms.JMSExceptionGet the message type.- Specified by:
getJMSTypein interfacejakarta.jms.Message- Returns:
- the message type
- Throws:
jakarta.jms.JMSException- if JMS fails to get JMS message type due to some internal JMS error.
-
setJMSType
public void setJMSType(java.lang.String type) throws jakarta.jms.JMSExceptionSet the message type.Some JMS providers use a message repository that contains the definition of messages sent by applications. The type header field contains the name of a message's definition.
JMS does not define a standard message definition repository nor does it define a naming policy for the definitions it contains. JMS clients should use symbolic values for type that can be configured at installation time to the values defined in the current providers message repository.
JMS clients should assign a value to type whether the application makes use of it or not. This insures that it is properly set for those providers that require it.
- Specified by:
setJMSTypein interfacejakarta.jms.Message- Parameters:
type- the class of message- Throws:
jakarta.jms.JMSException- if JMS fails to set JMS message type due to some internal JMS error.- See Also:
Message.getJMSType()
-
getJMSExpiration
public long getJMSExpiration() throws jakarta.jms.JMSExceptionGet the message's expiration value.When a message is sent, expiration is left unassigned. After completion of the send method, it holds the expiration time of the message. This is the sum of the time-to-live value specified by the client and the GMT at the time of the send.
If the time-to-live is specified as zero, expiration is set to zero which indicates the message does not expire.
When a message's expiration time is reached, a provider should discard it. JMS does not define any form of notification of message expiration.
Clients should not receive messages that have expired; however, JMS does not guarantee that this will not happen.
- Specified by:
getJMSExpirationin interfacejakarta.jms.Message- Returns:
- the time the message expires. It is the sum of the time-to-live value specified by the client, and the GMT at the time of the send.
- Throws:
jakarta.jms.JMSException- if JMS fails to get JMS message expiration due to some internal JMS error.
-
setJMSExpiration
public void setJMSExpiration(long expiration) throws jakarta.jms.JMSExceptionSet the message's expiration value.Providers set this field when a message is sent. This operation can be used to change the value of a message that's been received.
- Specified by:
setJMSExpirationin interfacejakarta.jms.Message- Parameters:
expiration- the message's expiration time- Throws:
jakarta.jms.JMSException- if JMS fails to set JMS message expiration due to some internal JMS error.- See Also:
Message.getJMSExpiration()
-
getJMSPriority
public int getJMSPriority() throws jakarta.jms.JMSExceptionGet the message priority.JMS defines a ten level priority value with 0 as the lowest priority and 9 as the highest. In addition, clients should consider priorities 0-4 as gradations of normal priority and priorities 5-9 as gradations of expedited priority.
JMS does not require that a provider strictly implement priority ordering of messages; however, it should do its best to deliver expedited messages ahead of normal messages.
- Specified by:
getJMSPriorityin interfacejakarta.jms.Message- Returns:
- the default message priority
- Throws:
jakarta.jms.JMSException- if JMS fails to get JMS message priority due to some internal JMS error.
-
setJMSPriority
public void setJMSPriority(int priority) throws jakarta.jms.JMSExceptionSet the priority for this message.Providers set this field when a message is sent. This operation can be used to change the value of a message that's been received.
- Specified by:
setJMSPriorityin interfacejakarta.jms.Message- Parameters:
priority- the priority of this message- Throws:
jakarta.jms.JMSException- if JMS fails to set JMS message priority due to some internal JMS error.- See Also:
Message.getJMSPriority()
-
clearProperties
public void clearProperties() throws jakarta.jms.JMSExceptionClear a message's properties.- Specified by:
clearPropertiesin interfacejakarta.jms.Message- Throws:
jakarta.jms.JMSException- if JMS fails to clear JMS message properties due to some internal JMS error.
-
propertyExists
public boolean propertyExists(java.lang.String name) throws jakarta.jms.JMSExceptionCheck if a property value exists.- Specified by:
propertyExistsin interfacejakarta.jms.Message- Parameters:
name- the name of the property to test- Returns:
- true if the property does exist.
- Throws:
jakarta.jms.JMSException- if JMS fails to check if property exists due to some internal JMS error.
-
getBooleanProperty
public boolean getBooleanProperty(java.lang.String name) throws jakarta.jms.JMSExceptionReturn the boolean property value with the given name.- Specified by:
getBooleanPropertyin interfacejakarta.jms.Message- Parameters:
name- the name of the boolean property- Returns:
- the boolean property value with the given name.
- Throws:
jakarta.jms.JMSException- if JMS fails to get Property due to some internal JMS error.jakarta.jms.MessageFormatException- if this type conversion is invalid.
-
getByteProperty
public byte getByteProperty(java.lang.String name) throws jakarta.jms.JMSExceptionReturn the byte property value with the given name.- Specified by:
getBytePropertyin interfacejakarta.jms.Message- Parameters:
name- the name of the byte property- Returns:
- the byte property value with the given name.
- Throws:
jakarta.jms.JMSException- if JMS fails to get Property due to some internal JMS error.jakarta.jms.MessageFormatException- if this type conversion is invalid.
-
getShortProperty
public short getShortProperty(java.lang.String name) throws jakarta.jms.JMSExceptionReturn the short property value with the given name.- Specified by:
getShortPropertyin interfacejakarta.jms.Message- Parameters:
name- the name of the short property- Returns:
- the short property value with the given name.
- Throws:
jakarta.jms.JMSException- if JMS fails to get Property due to some internal JMS error.jakarta.jms.MessageFormatException- if this type conversion is invalid.
-
getIntProperty
public int getIntProperty(java.lang.String name) throws jakarta.jms.JMSExceptionReturn the integer property value with the given name.- Specified by:
getIntPropertyin interfacejakarta.jms.Message- Parameters:
name- the name of the integer property- Returns:
- the integer property value with the given name.
- Throws:
jakarta.jms.JMSException- if JMS fails to get Property due to some internal JMS error.jakarta.jms.MessageFormatException- if this type conversion is invalid.
-
getLongProperty
public long getLongProperty(java.lang.String name) throws jakarta.jms.JMSExceptionReturn the long property value with the given name.- Specified by:
getLongPropertyin interfacejakarta.jms.Message- Parameters:
name- the name of the long property- Returns:
- the long property value with the given name.
- Throws:
jakarta.jms.JMSException- if JMS fails to get Property due to some internal JMS error.jakarta.jms.MessageFormatException- if this type conversion is invalid.
-
getFloatProperty
public float getFloatProperty(java.lang.String name) throws jakarta.jms.JMSExceptionReturn the float property value with the given name.- Specified by:
getFloatPropertyin interfacejakarta.jms.Message- Parameters:
name- the name of the float property- Returns:
- the float property value with the given name.
- Throws:
jakarta.jms.JMSException- if JMS fails to get Property due to some internal JMS error.jakarta.jms.MessageFormatException- if this type conversion is invalid.
-
getDoubleProperty
public double getDoubleProperty(java.lang.String name) throws jakarta.jms.JMSExceptionReturn the double property value with the given name.- Specified by:
getDoublePropertyin interfacejakarta.jms.Message- Parameters:
name- the name of the double property- Returns:
- the double property value with the given name.
- Throws:
jakarta.jms.JMSException- if JMS fails to get Property due to some internal JMS error.jakarta.jms.MessageFormatException- if this type conversion is invalid.
-
getStringProperty
public java.lang.String getStringProperty(java.lang.String name) throws jakarta.jms.JMSExceptionReturn the String property value with the given name.- Specified by:
getStringPropertyin interfacejakarta.jms.Message- Parameters:
name- the name of the String property- Returns:
- the String property value with the given name. If there is no property by this name, a null value is returned.
- Throws:
jakarta.jms.JMSException- if JMS fails to get Property due to some internal JMS error.jakarta.jms.MessageFormatException- if this type conversion is invalid.
-
getObjectProperty
public java.lang.Object getObjectProperty(java.lang.String name) throws jakarta.jms.JMSExceptionReturn the Java object property value with the given name.Note that this method can be used to return in objectified format, an object that had been stored as a property in the Message with the equivalent
setObjectmethod call, or it's equivalent primitive setmethod. - Specified by:
getObjectPropertyin interfacejakarta.jms.Message- Parameters:
name- the name of the Java object property- Returns:
- the Java object property value with the given name, in objectified format (ie. if it set as an int, then a Integer is returned). If there is no property by this name, a null value is returned.
- Throws:
jakarta.jms.JMSException- if JMS fails to get Property due to some internal JMS error.
-
getPropertyNames
public java.util.Enumeration getPropertyNames() throws jakarta.jms.JMSExceptionReturn an Enumeration of all the property names.- Specified by:
getPropertyNamesin interfacejakarta.jms.Message- Returns:
- an enumeration of all the names of property values.
- Throws:
jakarta.jms.JMSException- if JMS fails to get Property names due to some internal JMS error.
-
setBooleanProperty
public void setBooleanProperty(java.lang.String name, boolean value) throws jakarta.jms.JMSExceptionSet a boolean property value with the given name, into the Message.- Specified by:
setBooleanPropertyin interfacejakarta.jms.Message- Parameters:
name- the name of the boolean propertyvalue- the boolean property value to set in the Message.- Throws:
jakarta.jms.JMSException- if JMS fails to set Property due to some internal JMS error.jakarta.jms.MessageNotWriteableException- if properties are read-only
-
setByteProperty
public void setByteProperty(java.lang.String name, byte value) throws jakarta.jms.JMSExceptionSet a byte property value with the given name, into the Message.- Specified by:
setBytePropertyin interfacejakarta.jms.Message- Parameters:
name- the name of the byte propertyvalue- the byte property value to set in the Message.- Throws:
jakarta.jms.JMSException- if JMS fails to set Property due to some internal JMS error.jakarta.jms.MessageNotWriteableException- if properties are read-only
-
setShortProperty
public void setShortProperty(java.lang.String name, short value) throws jakarta.jms.JMSExceptionSet a short property value with the given name, into the Message.- Specified by:
setShortPropertyin interfacejakarta.jms.Message- Parameters:
name- the name of the short propertyvalue- the short property value to set in the Message.- Throws:
jakarta.jms.JMSException- if JMS fails to set Property due to some internal JMS error.jakarta.jms.MessageNotWriteableException- if properties are read-only
-
setIntProperty
public void setIntProperty(java.lang.String name, int value) throws jakarta.jms.JMSExceptionSet an integer property value with the given name, into the Message.- Specified by:
setIntPropertyin interfacejakarta.jms.Message- Parameters:
name- the name of the integer propertyvalue- the integer property value to set in the Message.- Throws:
jakarta.jms.JMSException- if JMS fails to set Property due to some internal JMS error.jakarta.jms.MessageNotWriteableException- if properties are read-only
-
setLongProperty
public void setLongProperty(java.lang.String name, long value) throws jakarta.jms.JMSExceptionSet a long property value with the given name, into the Message.- Specified by:
setLongPropertyin interfacejakarta.jms.Message- Parameters:
name- the name of the long propertyvalue- the long property value to set in the Message.- Throws:
jakarta.jms.JMSException- if JMS fails to set Property due to some internal JMS error.jakarta.jms.MessageNotWriteableException- if properties are read-only
-
setFloatProperty
public void setFloatProperty(java.lang.String name, float value) throws jakarta.jms.JMSExceptionSet a float property value with the given name, into the Message.- Specified by:
setFloatPropertyin interfacejakarta.jms.Message- Parameters:
name- the name of the float propertyvalue- the float property value to set in the Message.- Throws:
jakarta.jms.JMSException- if JMS fails to set Property due to some internal JMS error.jakarta.jms.MessageNotWriteableException- if properties are read-only
-
setDoubleProperty
public void setDoubleProperty(java.lang.String name, double value) throws jakarta.jms.JMSExceptionSet a double property value with the given name, into the Message.- Specified by:
setDoublePropertyin interfacejakarta.jms.Message- Parameters:
name- the name of the double propertyvalue- the double property value to set in the Message.- Throws:
jakarta.jms.JMSException- if JMS fails to set Property due to some internal JMS error.jakarta.jms.MessageNotWriteableException- if properties are read-only
-
setStringProperty
public void setStringProperty(java.lang.String name, java.lang.String value) throws jakarta.jms.JMSExceptionSet a String property value with the given name, into the Message.- Specified by:
setStringPropertyin interfacejakarta.jms.Message- Parameters:
name- the name of the String propertyvalue- the String property value to set in the Message.- Throws:
jakarta.jms.JMSException- if JMS fails to set Property due to some internal JMS error.jakarta.jms.MessageNotWriteableException- if properties are read-only
-
setObjectProperty
public void setObjectProperty(java.lang.String name, java.lang.Object value) throws jakarta.jms.JMSExceptionSet a Java object property value with the given name, into the Message.Note that this method only works for the objectified primitive object types (Integer, Double, Long ...) and String's.
- Specified by:
setObjectPropertyin interfacejakarta.jms.Message- Parameters:
name- the name of the Java object property.value- the Java object property value to set in the Message.- Throws:
jakarta.jms.JMSException- if JMS fails to set Property due to some internal JMS error.jakarta.jms.MessageFormatException- if object is invalidjakarta.jms.MessageNotWriteableException- if properties are read-only
-
acknowledge
public void acknowledge() throws jakarta.jms.JMSExceptionAcknowledge this and all previous messages received.All JMS messages support the acknowledge() method for use when a client has specified that a JMS consumers messages are to be explicitly acknowledged.
JMS defaults to implicit message acknowledgement. In this mode, calls to acknowledge() are ignored.
Acknowledgment of a message automatically acknowledges all messages previously received by the consumer. Clients may individually acknowledge messages or they may choose to acknowledge messages in application defined groups (which is done by acknowledging the last received message in the group).
Messages that have been received but not acknowledged may be redelivered to the consumer.
- Specified by:
acknowledgein interfacejakarta.jms.Message- Throws:
jakarta.jms.JMSException- if JMS fails to acknowledge due to some internal JMS error.
-
clearBody
public void clearBody() throws jakarta.jms.JMSExceptionClear out the message body. All other parts of the message are left untouched.- Specified by:
clearBodyin interfacejakarta.jms.Message- Throws:
jakarta.jms.JMSException- if JMS fails to due to some internal JMS error.
-
reset
public void reset() throws jakarta.jms.JMSException- Throws:
jakarta.jms.JMSException
-
getJMSDeliveryTime
public long getJMSDeliveryTime() throws jakarta.jms.JMSException- Specified by:
getJMSDeliveryTimein interfacejakarta.jms.Message- Throws:
jakarta.jms.JMSException
-
setJMSDeliveryTime
public void setJMSDeliveryTime(long l) throws jakarta.jms.JMSException- Specified by:
setJMSDeliveryTimein interfacejakarta.jms.Message- Throws:
jakarta.jms.JMSException
-
getBody
public <T> T getBody(java.lang.Class<T> aClass) throws jakarta.jms.JMSException- Specified by:
getBodyin interfacejakarta.jms.Message- Throws:
jakarta.jms.JMSException
-
isBodyAssignableTo
public boolean isBodyAssignableTo(java.lang.Class aClass) throws jakarta.jms.JMSException- Specified by:
isBodyAssignableToin interfacejakarta.jms.Message- Throws:
jakarta.jms.JMSException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-