|
||||||||||
| 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
public class DefaultMessage
The default implementation of Message
| Constructor Summary | |
|---|---|
DefaultMessage()
|
|
| Method Summary | ||
|---|---|---|
void |
addAttachment(String id,
DataHandler content)
Adds an attachment to the message using the id |
|
protected Map<String,DataHandler> |
createAttachments()
A factory method to lazily create the attachments to make it easy to create efficient Message implementations which only construct and populate the Map on demand |
|
String |
createExchangeId()
Returns the unique ID for a message exchange if this message is capable of creating one or null if not |
|
protected Map<String,Object> |
createHeaders()
A factory method to lazily create the headers to make it easy to create efficient Message implementations which only construct and populate the Map on demand |
|
DataHandler |
getAttachment(String id)
Returns the attachment specified by the id |
|
Set<String> |
getAttachmentNames()
Returns a set of attachment names of the message |
|
Map<String,DataHandler> |
getAttachments()
Returns all attachments of the message |
|
Object |
getHeader(String name)
Accesses a specific header |
|
|
getHeader(String name,
Class<T> type)
Returns a header associated with this message by name and specifying the type required |
|
Map<String,Object> |
getHeaders()
Returns all of the headers associated with the message |
|
boolean |
hasAttachments()
Returns true if this message has any attachments. |
|
protected boolean |
hasPopulatedHeaders()
Returns true if the headers have been mutated in some way |
|
DefaultMessage |
newInstance()
Returns a new instance |
|
protected void |
populateInitialAttachments(Map<String,DataHandler> map)
A strategy method populate the initial set of attachments on an inbound message from an underlying binding |
|
protected void |
populateInitialHeaders(Map<String,Object> map)
A strategy method populate the initial set of headers on an inbound message from an underlying binding |
|
void |
removeAttachment(String id)
Removes the attachment specified by the id |
|
Object |
removeHeader(String name)
Removes the named header from this message |
|
void |
setAttachments(Map<String,DataHandler> attachments)
Set all the attachments associated with this 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 |
|
String |
toString()
|
|
| Methods inherited from class org.apache.camel.impl.MessageSupport |
|---|
copy, copyFrom, createBody, createMessageId, getBody, getBody, getBody, getExchange, getMessageId, setBody, setBody, setExchange, setMessageId |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultMessage()
| Method Detail |
|---|
public String toString()
toString in class Objectpublic Object getHeader(String name)
Message
name - name of header
public <T> T getHeader(String name,
Class<T> type)
Message
name - the name of the headertype - the type of the header
public void setHeader(String name,
Object value)
Message
name - of the headervalue - to associate with the namepublic Object removeHeader(String name)
Message
name - name of the header
public Map<String,Object> getHeaders()
Message
public void setHeaders(Map<String,Object> headers)
Message
headers - headers to setpublic DefaultMessage newInstance()
MessageSupport
newInstance in class MessageSupportprotected Map<String,Object> createHeaders()
protected void populateInitialHeaders(Map<String,Object> map)
map - is the empty header map to populateprotected Map<String,DataHandler> createAttachments()
protected void populateInitialAttachments(Map<String,DataHandler> map)
map - is the empty attachment map to populate
public void addAttachment(String id,
DataHandler content)
Message
id - the id to store the attachment undercontent - the data handler for the attachmentpublic DataHandler getAttachment(String id)
Message
id - the id under which the attachment is stored
public Set<String> getAttachmentNames()
Message
public void removeAttachment(String id)
Message
id - the id of the attachment to removepublic Map<String,DataHandler> getAttachments()
Message
public void setAttachments(Map<String,DataHandler> attachments)
Message
attachments - attachementspublic boolean hasAttachments()
Message
protected boolean hasPopulatedHeaders()
public String createExchangeId()
Message
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||