public interface Message
Message
represents an individual input or output of a service, the
content of which is interpreted by service implementation logic. A Message
does not carry context specific to a service invocation, which means that it
can be copied and reused across service invocations.
There are two distinct parts to a message:
Modifier and Type | Method and Description |
---|---|
Message |
addAttachment(String name,
DataSource attachment)
Adds an attachment to the message with the specified name.
|
Message |
copy()
Return copy of message.
|
DataSource |
getAttachment(String name)
Retrieves the named attachment from the message.
|
Map<String,DataSource> |
getAttachmentMap()
Returns a map containing all attachments to this message.
|
Object |
getContent()
Returns the content from the body of the message.
|
<T> T |
getContent(Class<T> type)
Convenience method used to retrieve a typed instance of the message body.
|
Context |
getContext()
Retrieves the message context.
|
void |
removeAttachment(String name)
Removes the named attachment from this message.
|
Message |
setContent(Object content)
Assigns the specified content to the body of this message.
|
Context getContext()
Message setContent(Object content)
content
- message body contentthis
message instance.Object getContent()
<T> T getContent(Class<T> type)
T
- typetype
- body content typeMessage addAttachment(String name, DataSource attachment)
name
- attachment nameattachment
- attachment contentthis
message instance.DataSource getAttachment(String name)
name
- name of the attachmentvoid removeAttachment(String name)
name
- the attachment nameMap<String,DataSource> getAttachmentMap()
Message copy()
Copyright © 2013–2020 JBoss by Red Hat. All rights reserved.