|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.esb.message.Message
public class Message
Message type.
The differences between this Message model and the existing one are small, but I think they are very important from a user perspective. See issues with current message, as I see them. So we're really just talking about a few tweaks:Collection
types.
Apart from the fact that people recognize thse types, it makes the Message easier
to work with using expression and scripting languages such as OGNL, Groovy, Jython etc because
many of these tools have explicit usability features around Collection
types (Map
, List
, Properties
etc).Message -| |-properties--| | |-<Name Value Pairs> | |-addressing--| | |-<to, from, replyto etc - Logical names Vs current EPR approach> | |-body <PrimaryPayload
instance (aka "payload" or "content")> | |-attachments-| | |-<Map ofPayload
instances> | |-fault
Payload
can be attached and retreived from a Message instance via the
getBody()
and setBody(Payload)
methods.
Other payloads
can be attached to the message, but only as attachments
.
This would seem to be in line with the SOAP spec re attachments.
This doesn't preclude the primary payload being a collection of items.
We could add a Map
of "secondary" message payloads. I think this concept would then
be competing with the idea of attachments, leading to confusion. This has happened with the existing
Message structure.
// Create and populate the message.... Message message = newWhat about message serialization?.Message(myMessageObject)
; message.getAttachments().put("image-01", newPayload
(imageBytes, "image/jpeg")); ... etc // Deliver the message to the target Service... ServiceInvoker invoker = new ServiceInvoker("category", "name"); invoker.deliverAsync(invoker); // handle faults etc...
Constructor Summary | |
---|---|
Message()
Construct a message with a blank payload. |
|
Message(Object bodyContent)
Construct a message with the supplied payload content. |
|
Message(Payload body)
Construct a message with the supplied payload. |
Method Summary | |
---|---|
Addressing |
getAddressing()
Get Message addressing info. |
Map<String,Payload> |
getAttachments()
Message attachments. |
Payload |
getBody()
Get the Primary message payload. |
Fault |
getFault()
Get Message fault. |
Properties |
getProperties()
Message Properties. |
void |
setBody(Payload body)
Set the Primary message payload. |
void |
setFault(Fault fault)
Set Message fault. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Message()
public Message(Payload body)
body
- The primary message payload.getAttachments()
public Message(Object bodyContent)
Message message = new Message(new Payload
(payloadObject));
bodyContent
- The primary message payload content.getAttachments()
Method Detail |
---|
public Properties getProperties()
public Addressing getAddressing()
public Payload getBody()
public void setBody(Payload body)
body
- Primary Message payload Object.public Map<String,Payload> getAttachments()
public Fault getFault()
public void setFault(Fault fault)
fault
- Message Fault, or null if there is none.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |