public abstract class MessageSupport extends Object implements org.apache.camel.Message, org.apache.camel.CamelContextAware, org.apache.camel.spi.DataTypeAware
Message body handling features but letting the derived class deal
with headers.
Unless a specific provider wishes to do something particularly clever with
headers you probably want to just derive from DefaultMessage| Constructor and Description |
|---|
MessageSupport() |
| Modifier and Type | Method and Description |
|---|---|
org.apache.camel.Message |
copy() |
void |
copyAttachments(org.apache.camel.Message that) |
void |
copyFrom(org.apache.camel.Message that) |
void |
copyFromWithNewBody(org.apache.camel.Message that,
Object newBody) |
protected Object |
createBody()
A factory method to allow a provider to lazily create the message body
for inbound messages from other sources
|
protected String |
createMessageId()
Allow implementations to auto-create a messageId
|
Object |
getBody() |
<T> T |
getBody(Class<T> type) |
protected <T> T |
getBody(Class<T> type,
Object body) |
org.apache.camel.CamelContext |
getCamelContext() |
org.apache.camel.spi.DataType |
getDataType() |
org.apache.camel.Exchange |
getExchange() |
Object |
getMandatoryBody() |
<T> T |
getMandatoryBody(Class<T> type) |
String |
getMessageId() |
boolean |
hasDataType() |
abstract org.apache.camel.Message |
newInstance()
Returns a new instance
|
void |
setBody(Object body) |
<T> void |
setBody(Object value,
Class<T> type) |
void |
setBody(Object body,
org.apache.camel.spi.DataType type) |
void |
setCamelContext(org.apache.camel.CamelContext camelContext) |
void |
setDataType(org.apache.camel.spi.DataType type) |
void |
setExchange(org.apache.camel.Exchange exchange) |
void |
setMessageId(String messageId) |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddAttachment, addAttachmentObject, getAttachment, getAttachmentNames, getAttachmentObject, getAttachmentObjects, getAttachments, getHeader, getHeader, getHeader, getHeader, getHeader, getHeader, getHeaders, hasAttachments, hasHeaders, isFault, removeAttachment, removeHeader, removeHeaders, removeHeaders, setAttachmentObjects, setAttachments, setFault, setHeader, setHeaderspublic Object getBody()
getBody in interface org.apache.camel.Messagepublic <T> T getBody(Class<T> type)
getBody in interface org.apache.camel.Messagepublic Object getMandatoryBody() throws org.apache.camel.InvalidPayloadException
getMandatoryBody in interface org.apache.camel.Messageorg.apache.camel.InvalidPayloadExceptionpublic <T> T getMandatoryBody(Class<T> type) throws org.apache.camel.InvalidPayloadException
getMandatoryBody in interface org.apache.camel.Messageorg.apache.camel.InvalidPayloadExceptionpublic void setBody(Object body)
setBody in interface org.apache.camel.Messagepublic <T> void setBody(Object value, Class<T> type)
setBody in interface org.apache.camel.Messagepublic void setBody(Object body, org.apache.camel.spi.DataType type)
setBody in interface org.apache.camel.spi.DataTypeAwarepublic org.apache.camel.spi.DataType getDataType()
getDataType in interface org.apache.camel.spi.DataTypeAwarepublic void setDataType(org.apache.camel.spi.DataType type)
setDataType in interface org.apache.camel.spi.DataTypeAwarepublic boolean hasDataType()
hasDataType in interface org.apache.camel.spi.DataTypeAwarepublic org.apache.camel.Message copy()
copy in interface org.apache.camel.Messagepublic void copyFrom(org.apache.camel.Message that)
copyFrom in interface org.apache.camel.Messagepublic void copyFromWithNewBody(org.apache.camel.Message that,
Object newBody)
copyFromWithNewBody in interface org.apache.camel.Messagepublic org.apache.camel.Exchange getExchange()
getExchange in interface org.apache.camel.Messagepublic void setExchange(org.apache.camel.Exchange exchange)
public org.apache.camel.CamelContext getCamelContext()
getCamelContext in interface org.apache.camel.CamelContextAwarepublic void setCamelContext(org.apache.camel.CamelContext camelContext)
setCamelContext in interface org.apache.camel.CamelContextAwarepublic void copyAttachments(org.apache.camel.Message that)
copyAttachments in interface org.apache.camel.Messagepublic abstract org.apache.camel.Message newInstance()
protected Object createBody()
public String getMessageId()
getMessageId in interface org.apache.camel.Messagepublic void setMessageId(String messageId)
setMessageId in interface org.apache.camel.Messageprotected String createMessageId()
Apache Camel