|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectguarana.framework.message.Message<T>
public class Message<T>
An abstraction of a piece of information that is exchanged and transformed across an EAI solution. The structure of messages depends completely on the solutions in which they are involved.
Field Summary | |
---|---|
static long |
serialVersionUID
|
Constructor Summary | |
---|---|
Message()
Constructs a new message. |
|
Message(Message<?> parent)
Constructs a new message that has a given message as parent. |
Method Summary | |
---|---|
Object |
addAttachment(String name,
Object attachment)
Adds an attachment to this message. |
void |
addParent(Message<?> parent)
Adds a parent to the message. |
int |
compareTo(Message<T> msg)
|
Message<T> |
copy()
Creates a copy of this message. |
Object |
getAttachment(String name)
Returns the attachment associated with the given name. |
Set<String> |
getAttachmentNames()
Returns all attachment names. |
Map<String,Object> |
getAttachments()
Returns all attachments from this message. |
T |
getBody()
Return the body of this message. |
Header |
getHeader()
Returns the header of this message. |
boolean |
hasAttachements()
Checks if this message has attachments. |
Object |
removeAttachment(String name)
Removes an attachment from this message. |
void |
setAttachments(Map<String,Object> attachments)
Sets several attachments at once for a message. |
void |
setBody(T body)
Sets the body of the message. |
void |
setHeader(Header header)
Sets the header of this message. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final long serialVersionUID
Constructor Detail |
---|
public Message()
public Message(Message<?> parent)
parent
- The parent message of this current message.Method Detail |
---|
public Message<T> copy()
null
if the message could not be copied.public void addParent(Message<?> parent)
parent
- The parent message of this current message.public Object addAttachment(String name, Object attachment)
name
- The name of the attachment.attachment
- The attachment.
null
if there is no previous attachment with this name.public Object removeAttachment(String name)
name
- The name of the attachment.
null
if there is no attachment mapped with this name.public Object getAttachment(String name)
name
- The name of the attachment.
null
if there is no value associated with the given name.public Set<String> getAttachmentNames()
public boolean hasAttachements()
public Header getHeader()
public void setHeader(Header header)
header
- a header for this message.public T getBody()
public void setBody(T body)
body
- The body of this messagepublic Map<String,Object> getAttachments()
public void setAttachments(Map<String,Object> attachments)
attachments
- A map structure with several attachments.public int compareTo(Message<T> msg)
compareTo
in interface Comparable<Message<T>>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |