org.jboss.soa.esb.message
Interface Body


public interface Body

The message body holds arbitrary information which represents the payload as far as clients and services are concerned. A body may contain: (i) a byte array for arbitrary data. How that array is interpreted by the service is implementation specific and outside the scope of the ESB to enforce. (ii) a list of Objects of arbitrary types. How these objects are serialized to/from the message body when it is transmitted is up to the specific Object type. The plan is to add support for various TYPES of Object and the message implementation will use external adapters to externalize/internalize the Objects. Currently we only support Serializable objects.


Method Summary
 void add(java.lang.String name, java.lang.Object value)
          Add the specified Object to the body.
 java.lang.Object get(java.lang.String name)
          Get the specified Object, or null if not present.
 byte[] getContents()
           
 void merge(Body b)
          Merge two bodies.
 java.lang.Object remove(java.lang.String name)
          Remove the specified Object and return it, or null if not present.
 void replace(Body b)
          Replace this body instance with the one given.
 void setContents(byte[] content)
          Set the byte content of the body.
 

Method Detail

add

void add(java.lang.String name,
         java.lang.Object value)
Add the specified Object to the body.

Parameters:
name - the name of the object. MUST be unique within this body.
value - the Object to add.

get

java.lang.Object get(java.lang.String name)
Get the specified Object, or null if not present.

Parameters:
name - the name of the Object to retrieve.
Returns:
the Object.

remove

java.lang.Object remove(java.lang.String name)
Remove the specified Object and return it, or null if not present.

Parameters:
name - the name of the Object to remove.
Returns:
the Object removed.

setContents

void setContents(byte[] content)
Set the byte content of the body.

Parameters:
content - the message bytes

getContents

byte[] getContents()
Returns:
the byte content of the body.

replace

void replace(Body b)
Replace this body instance with the one given.

Parameters:
b - the body to be replaced with.

merge

void merge(Body b)
Merge two bodies.

Parameters:
b - the body to be merged with.