public class JmsMessageAdapter extends AbstractMessageAdapter
JmsMessageAdapter
allows a DefaultMuleEvent
to access the
properties and payload of a JMS Message in a uniform way. The JmsMessageAdapter
expects a message of type javax.jms.Message and will throw an
IllegalArgumentException if the source message type is not compatible. The
JmsMessageAdapter should be suitable for all JMS Connector implementations.ThreadSafeAccess.AccessControl
attachments, encoding, exceptionPayload, id, logger, properties
READ, WRITE
Modifier | Constructor and Description |
---|---|
protected |
JmsMessageAdapter(JmsMessageAdapter template) |
|
JmsMessageAdapter(Object message) |
Modifier and Type | Method and Description |
---|---|
String |
getCorrelationId()
Sets a correlationId for this message.
|
Object |
getPayload() |
byte[] |
getPayloadAsBytes()
Converts the message implementation into a String representation
|
String |
getPayloadAsString(String encoding)
Converts the message implementation into a String representation
|
Object |
getReplyTo()
Sets a replyTo address for this message.
|
String |
getUniqueId()
gets the unique identifier for the message.
|
ThreadSafeAccess |
newThreadCopy() |
void |
setCorrelationId(String id)
Sets a correlationId for this message.
|
void |
setReplyTo(Object replyTo)
Sets a replyTo address for this message.
|
void |
setSpecification(String newSpec) |
addAttachment, addInboundProperties, addProperties, addProperties, assertAccess, clearProperties, getAttachment, getAttachmentNames, getBooleanProperty, getCorrelationGroupSize, getCorrelationSequence, getDoubleProperty, getEncoding, getExceptionPayload, getIntProperty, getLongProperty, getProperty, getProperty, getPropertyNames, getStringProperty, isDisabled, newException, release, removeAttachment, removeProperty, resetAccessControl, setBooleanProperty, setCorrelationGroupSize, setCorrelationSequence, setDoubleProperty, setEncoding, setExceptionPayload, setIntProperty, setLongProperty, setProperty, setProperty, setStringProperty, toString
public JmsMessageAdapter(Object message) throws MessagingException
MessagingException
protected JmsMessageAdapter(JmsMessageAdapter template)
public void setSpecification(String newSpec)
public String getPayloadAsString(String encoding) throws Exception
encoding
- The encoding to use when transforming the message (if
necessary). The parameter is used when converting from a byte arrayException
- Implementation may throw an endpoint specific exceptionpublic byte[] getPayloadAsBytes() throws Exception
Exception
- Implemetation may throw an endpoint specific exceptionpublic Object getPayload()
public String getUniqueId()
AbstractMessageAdapter
getUniqueId
in interface MessageAdapter
getUniqueId
in class AbstractMessageAdapter
public void setCorrelationId(String id)
setCorrelationId
in interface MessageAdapter
setCorrelationId
in class AbstractMessageAdapter
id
- the Id reference for this relationshippublic String getCorrelationId()
getCorrelationId
in interface MessageAdapter
getCorrelationId
in class AbstractMessageAdapter
public void setReplyTo(Object replyTo)
setReplyTo
in interface MessageAdapter
setReplyTo
in class AbstractMessageAdapter
replyTo
- the endpointUri url to reply topublic Object getReplyTo()
getReplyTo
in interface MessageAdapter
getReplyTo
in class AbstractMessageAdapter
public ThreadSafeAccess newThreadCopy()
AbstractMessageAdapter
newThreadCopy
in interface ThreadSafeAccess
newThreadCopy
in class AbstractMessageAdapter
Copyright © 2003–2013 MuleSource, Inc.. All rights reserved.