org.jboss.soa.esb.message.body.content
Class Payload
java.lang.Object
org.jboss.soa.esb.message.body.content.Payload
public class Payload
- extends java.lang.Object
Different message formats represent views on the underlying Message Body,
i.e., payload. They do not change how the content is represented on the wire,
only how it can be more easily interpreted within the application. These are
essentially helper classes.
In order to use, first create your Message (via the factory) and then pass it
to the appropriate method of this class. Use the returned Body type to then
populate your Message before sending it. At the receiver, you can get the type by
calling bodyType and then use the right method to get the Body type back for
use. If you try to use it as the wrong type, you'll get an exception.
It is not possible currently to change between types, i.e., to give different
"views" on to the same underlying message structure. However, that is relatively
simple to implement if needed.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CONTENT_TYPE
public static final java.lang.String CONTENT_TYPE
- See Also:
- Constant Field Values
RAW_BODY
public static final java.lang.String RAW_BODY
- See Also:
- Constant Field Values
BYTES_BODY
public static final java.lang.String BYTES_BODY
- See Also:
- Constant Field Values
MAP_BODY
public static final java.lang.String MAP_BODY
- See Also:
- Constant Field Values
OBJECT_BODY
public static final java.lang.String OBJECT_BODY
- See Also:
- Constant Field Values
TEXT_BODY
public static final java.lang.String TEXT_BODY
- See Also:
- Constant Field Values
Payload
public Payload()
bodyType
public static final java.lang.String bodyType(Message msg)
createBytesBody
public static final BytesBody createBytesBody(Message msg)
throws InvalidPayloadException
- Throws:
InvalidPayloadException
createMapBody
public static final MapBody createMapBody(Message msg)
throws InvalidPayloadException
- Throws:
InvalidPayloadException
createObjectBody
public static final ObjectBody createObjectBody(Message msg)
throws InvalidPayloadException
- Throws:
InvalidPayloadException
createTextBody
public static final TextBody createTextBody(Message msg)
throws InvalidPayloadException
- Throws:
InvalidPayloadException