|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.camel.impl.MessageSupport
org.apache.camel.impl.DefaultMessage
org.apache.camel.component.jms.JmsMessage
public class JmsMessage
Represents a Message for working with JMS
| Constructor Summary | |
|---|---|
JmsMessage(javax.jms.Message jmsMessage,
JmsBinding binding)
|
|
| Method Summary | |
|---|---|
void |
copyFrom(Message that)
Copies the contents of the other message into this message |
protected Object |
createBody()
A factory method to allow a provider to lazily create the message body for inbound messages from other sources |
String |
createExchangeId()
Returns the unique ID for a message exchange if this message is capable of creating one or null if not |
protected String |
createMessageId()
Lets allow implementations to auto-create a messageId |
protected void |
ensureInitialHeaders()
Ensure that the headers have been populated from the underlying JMS message before we start mutating the headers |
JmsBinding |
getBinding()
|
Object |
getHeader(String name)
Accesses a specific header |
Map<String,Object> |
getHeaders()
Returns all of the headers associated with the message. |
javax.jms.Message |
getJmsMessage()
Returns the underlying JMS message |
JmsMessage |
newInstance()
Returns a new instance |
protected void |
populateInitialHeaders(Map<String,Object> map)
A strategy method populate the initial set of headers on an inbound message from an underlying binding |
Object |
removeHeader(String name)
Removes the named header from this message |
void |
setBinding(JmsBinding binding)
|
void |
setBody(Object body)
Sets the body of the message |
void |
setHeader(String name,
Object value)
Sets a header on the message |
void |
setHeaders(Map<String,Object> headers)
Set all the headers associated with this message |
void |
setJmsMessage(javax.jms.Message jmsMessage)
|
boolean |
shouldCreateNewMessage()
Returns true if a new JMS message instance should be created to send to the next component |
String |
toString()
|
| Methods inherited from class org.apache.camel.impl.DefaultMessage |
|---|
addAttachment, createAttachments, createHeaders, getAttachment, getAttachmentNames, getAttachments, getHeader, getHeader, getHeader, hasAttachments, hasHeaders, hasPopulatedHeaders, isFault, populateInitialAttachments, removeAttachment, removeHeaders, removeHeaders, setAttachments, setFault |
| Methods inherited from class org.apache.camel.impl.MessageSupport |
|---|
copy, getBody, getBody, getBody, getExchange, getMandatoryBody, getMandatoryBody, getMessageId, setBody, setExchange, setMessageId |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public JmsMessage(javax.jms.Message jmsMessage,
JmsBinding binding)
| Method Detail |
|---|
public String toString()
toString in class DefaultMessagepublic void copyFrom(Message that)
Message
copyFrom in interface MessagecopyFrom in class DefaultMessagethat - the other messagepublic javax.jms.Message getJmsMessage()
public JmsBinding getBinding()
public void setBinding(JmsBinding binding)
public void setJmsMessage(javax.jms.Message jmsMessage)
public void setBody(Object body)
Message
setBody in interface MessagesetBody in class MessageSupportbody - the bodypublic Object getHeader(String name)
Message
getHeader in interface MessagegetHeader in class DefaultMessagename - name of header
public Map<String,Object> getHeaders()
MessageDefaultMessage for how headers
is represented in Camel using a CaseInsensitiveMap.
Important: If you want to walk the returned Map and fetch all the keys and values, you should use
the Map.entrySet() method, which ensure you get the keys in the original case.
getHeaders in interface MessagegetHeaders in class DefaultMessagepublic Object removeHeader(String name)
Message
removeHeader in interface MessageremoveHeader in class DefaultMessagename - name of the header
public void setHeaders(Map<String,Object> headers)
Message
setHeaders in interface MessagesetHeaders in class DefaultMessageheaders - headers to set
public void setHeader(String name,
Object value)
Message
setHeader in interface MessagesetHeader in class DefaultMessagename - of the headervalue - to associate with the namepublic JmsMessage newInstance()
MessageSupport
newInstance in class DefaultMessagepublic boolean shouldCreateNewMessage()
protected void ensureInitialHeaders()
protected Object createBody()
MessageSupport
createBody in class MessageSupportprotected void populateInitialHeaders(Map<String,Object> map)
DefaultMessage
populateInitialHeaders in class DefaultMessagemap - is the empty header map to populateprotected String createMessageId()
MessageSupport
createMessageId in class MessageSupportpublic String createExchangeId()
Message
createExchangeId in interface MessagecreateExchangeId in class DefaultMessage
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||